Skip to content

Commit

Permalink
Use more precise condition in #if
Browse files Browse the repository at this point in the history
The library can be embedded, so this is a better approach
  • Loading branch information
ltrzesniewski committed Dec 1, 2023
1 parent 5438503 commit 8a89e65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RazorBlade.Library/RazorTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected internal virtual void Write(IEncodedContent? content)
[EditorBrowsable(EditorBrowsableState.Never)]
protected internal void DefineSection(string name, Func<Task> action)
{
#if NETCOREAPP
#if NET6_0_OR_GREATER
if (!_sections.TryAdd(name, action))
throw new InvalidOperationException($"Section '{name}' is already defined.");
#else
Expand Down

0 comments on commit 8a89e65

Please sign in to comment.