Skip to content

Commit 59379f3

Browse files
authored
Fixed .NET compatibility of ported features. (#7782)
1 parent cde43b5 commit 59379f3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/HotChocolate/AspNetCore/src/AspNetCore.Authorization/DefaultAuthorizationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ public DefaultAuthorizationHandler(
4343
throw new ArgumentNullException(nameof(authorizationPolicyProvider));
4444
_authorizationPolicyCache = authorizationPolicyCache ??
4545
throw new ArgumentNullException(nameof(authorizationPolicyCache));
46-
46+
#if NET7_0_OR_GREATER
4747
_canCachePolicies = _authorizationPolicyProvider.AllowsCachingPolicies;
48+
#endif
4849
}
4950

5051
/// <summary>

src/HotChocolate/Core/src/Types/Types/Directives/SemanticNonNullDirective.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ namespace HotChocolate.Types;
55
[DirectiveType(WellKnownDirectives.SemanticNonNull, DirectiveLocation.FieldDefinition, IsRepeatable = false)]
66
public sealed class SemanticNonNullDirective(IReadOnlyList<int> levels)
77
{
8+
#if NETSTANDARD2_0
9+
[GraphQLType(typeof(ListType<NonNullType<IntType>>))]
10+
#else
811
[GraphQLType<ListType<NonNullType<IntType>>>]
12+
#endif
913
[DefaultValueSyntax("[0]")]
1014
public IReadOnlyList<int>? Levels { get; } = levels;
1115
}

0 commit comments

Comments
 (0)