12
12
using Microsoft . EntityFrameworkCore . Storage . ValueConversion ;
13
13
using Microsoft . EntityFrameworkCore . ValueGeneration ;
14
14
15
+ #nullable enable
16
+
15
17
// ReSharper disable once CheckNamespace
16
18
namespace Microsoft . EntityFrameworkCore
17
19
{
@@ -26,8 +28,8 @@ public static class ConventionPropertyExtensions
26
28
/// </summary>
27
29
/// <param name="property"> The foreign key property. </param>
28
30
/// <returns> The first associated principal property, or <see langword="null" /> if none exists. </returns>
29
- public static IConventionProperty FindFirstPrincipal ( [ NotNull ] this IConventionProperty property )
30
- => ( IConventionProperty ) ( ( IProperty ) property ) . FindFirstPrincipal ( ) ;
31
+ public static IConventionProperty ? FindFirstPrincipal ( [ NotNull ] this IConventionProperty property )
32
+ => ( IConventionProperty ? ) ( ( IProperty ) property ) . FindFirstPrincipal ( ) ;
31
33
32
34
/// <summary>
33
35
/// Finds the list of principal properties including the given property that the given property is constrained by
@@ -68,8 +70,8 @@ public static IEnumerable<IConventionIndex> GetContainingIndexes([NotNull] this
68
70
/// <returns>
69
71
/// The primary that use this property, or <see langword="null" /> if it is not part of the primary key.
70
72
/// </returns>
71
- public static IConventionKey FindContainingPrimaryKey ( [ NotNull ] this IConventionProperty property )
72
- => ( IConventionKey ) ( ( IProperty ) property ) . FindContainingPrimaryKey ( ) ;
73
+ public static IConventionKey ? FindContainingPrimaryKey ( [ NotNull ] this IConventionProperty property )
74
+ => ( IConventionKey ? ) ( ( IProperty ) property ) . FindContainingPrimaryKey ( ) ;
73
75
74
76
/// <summary>
75
77
/// Gets all primary or alternate keys that use this property (including composite keys in which this property
@@ -280,7 +282,7 @@ public static CoreTypeMapping SetTypeMapping(
280
282
/// </param>
281
283
/// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
282
284
/// <returns> The configured value. </returns>
283
- public static Func < IProperty , IEntityType , ValueGenerator > SetValueGeneratorFactory (
285
+ public static Func < IProperty , IEntityType , ValueGenerator > ? SetValueGeneratorFactory (
284
286
[ NotNull ] this IConventionProperty property ,
285
287
[ NotNull ] Func < IProperty , IEntityType , ValueGenerator > valueGeneratorFactory ,
286
288
bool fromDataAnnotation = false )
@@ -302,9 +304,9 @@ public static Func<IProperty, IEntityType, ValueGenerator> SetValueGeneratorFact
302
304
/// <param name="converter"> The converter, or <see langword="null" /> to remove any previously set converter. </param>
303
305
/// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
304
306
/// <returns> The configured value. </returns>
305
- public static ValueConverter SetValueConverter (
307
+ public static ValueConverter ? SetValueConverter (
306
308
[ NotNull ] this IConventionProperty property ,
307
- [ CanBeNull ] ValueConverter converter ,
309
+ [ CanBeNull ] ValueConverter ? converter ,
308
310
bool fromDataAnnotation = false )
309
311
=> property . AsProperty ( ) . SetValueConverter (
310
312
converter , fromDataAnnotation ? ConfigurationSource . DataAnnotation : ConfigurationSource . Convention ) ;
@@ -324,9 +326,9 @@ public static ValueConverter SetValueConverter(
324
326
/// <param name="providerClrType"> The type to use, or <see langword="null" /> to remove any previously set type. </param>
325
327
/// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
326
328
/// <returns> The configured value. </returns>
327
- public static Type SetProviderClrType (
329
+ public static Type ? SetProviderClrType (
328
330
[ NotNull ] this IConventionProperty property ,
329
- [ CanBeNull ] Type providerClrType ,
331
+ [ CanBeNull ] Type ? providerClrType ,
330
332
bool fromDataAnnotation = false )
331
333
=> property . AsProperty ( ) . SetProviderClrType (
332
334
providerClrType , fromDataAnnotation ? ConfigurationSource . DataAnnotation : ConfigurationSource . Convention ) ;
@@ -346,9 +348,9 @@ public static Type SetProviderClrType(
346
348
/// <param name="comparer"> The comparer, or <see langword="null" /> to remove any previously set comparer. </param>
347
349
/// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
348
350
/// <returns> The configured value. </returns>
349
- public static ValueComparer SetValueComparer (
351
+ public static ValueComparer ? SetValueComparer (
350
352
[ NotNull ] this IConventionProperty property ,
351
- [ CanBeNull ] ValueComparer comparer ,
353
+ [ CanBeNull ] ValueComparer ? comparer ,
352
354
bool fromDataAnnotation = false )
353
355
=> property . AsProperty ( ) . SetValueComparer (
354
356
comparer , fromDataAnnotation ? ConfigurationSource . DataAnnotation : ConfigurationSource . Convention ) ;
@@ -370,7 +372,7 @@ public static ValueComparer SetValueComparer(
370
372
[ Obsolete ( "Use SetValueComparer. Only a single value comparer is allowed for a given property." ) ]
371
373
public static void SetKeyValueComparer (
372
374
[ NotNull ] this IConventionProperty property ,
373
- [ CanBeNull ] ValueComparer comparer ,
375
+ [ CanBeNull ] ValueComparer ? comparer ,
374
376
bool fromDataAnnotation = false )
375
377
=> property . AsProperty ( ) . SetValueComparer (
376
378
comparer , fromDataAnnotation ? ConfigurationSource . DataAnnotation : ConfigurationSource . Convention ) ;
@@ -393,7 +395,7 @@ public static void SetKeyValueComparer(
393
395
[ Obsolete ( "Use SetValueComparer. Only a single value comparer is allowed for a given property." ) ]
394
396
public static void SetStructuralValueComparer (
395
397
[ NotNull ] this IConventionProperty property ,
396
- [ CanBeNull ] ValueComparer comparer ,
398
+ [ CanBeNull ] ValueComparer ? comparer ,
397
399
bool fromDataAnnotation = false )
398
400
=> property . SetKeyValueComparer ( comparer , fromDataAnnotation ) ;
399
401
0 commit comments