Skip to content

Commit 6e8d211

Browse files
RazorCodeGenerationOptions: Add convenience Create factory method
For consistency with RazorParserOptions, add a RazorCodeGenerationOptions.Create(...) convenience factory method to make it easier to create new RazorCodeGenerationOptions.
1 parent a14091b commit 6e8d211

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorCodeGenerationOptions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ private RazorCodeGenerationOptions(
5454
_flags = flags;
5555
}
5656

57+
public static RazorCodeGenerationOptions Create(Action<Builder> configure)
58+
{
59+
var builder = new Builder();
60+
configure?.Invoke(builder);
61+
62+
return builder.ToOptions();
63+
}
64+
5765
public bool DesignTime
5866
=> _flags.HasFlag(Flags.DesignTime);
5967

0 commit comments

Comments
 (0)