Skip to content

Commit ba3afd7

Browse files
shehrozeeeTheAtomicOption
authored andcommitted
added GeneratePdbSteram to the builderOptions instead of the ad pdb flag.
1 parent bf550ee commit ba3afd7

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

RazorEngineCore/IRazorEngine.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Task<IRazorEngineCompiledTemplate<T>> CompileAsync<T>(string content, Action<IRa
1313

1414
IRazorEngineCompiledTemplate Compile(string content, Action<IRazorEngineCompilationOptionsBuilder> builderAction = null);
1515

16-
IRazorEngineCompiledTemplate Compile(string content, Action<IRazorEngineCompilationOptionsBuilder> builderAction = null,bool addPdb=false);
17-
1816
Task<IRazorEngineCompiledTemplate> CompileAsync(string content, Action<IRazorEngineCompilationOptionsBuilder> builderAction = null);
1917
}
2018
}

RazorEngineCore/RazorEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public IRazorEngineCompiledTemplate Compile(string content, Action<IRazorEngineC
4141
compilationOptionsBuilder.Inherits(typeof(RazorEngineTemplateBase));
4242

4343
builderAction?.Invoke(compilationOptionsBuilder);
44-
if (addPdb)
44+
if (compilationOptionsBuilder.Options.GeneratePdbSteram)
4545
{
4646
MemoryStream pdbStream = new MemoryStream();
4747
MemoryStream memoryStream = this.CreateAndCompileToStream(content, compilationOptionsBuilder.Options, pdbStream);

RazorEngineCore/RazorEngineCompilationOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public class RazorEngineCompilationOptions
1414
public string TemplateNamespace { get; set; } = "TemplateNamespace";
1515
public string TemplateFilename { get; set; } = "";
1616
public string Inherits { get; set; } = "RazorEngineCore.RazorEngineTemplateBase";
17-
17+
///Set to true to generate PDB symbols information along with the assembly for debugging support
18+
public bool GeneratePdbSteram {get;set;} = false;
1819
public HashSet<string> DefaultUsings { get; set; } = new HashSet<string>()
1920
{
2021
"System.Linq",

0 commit comments

Comments
 (0)