-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Closed
Copy link
Milestone
Description
EF6.0
At current time I adding in my provider the support of ValueGenerationStrategy and trying to understand the implementation in exists providers :)
SqlServerPropertyExtensions code
efcore/src/EFCore.SqlServer/Extensions/SqlServerPropertyExtensions.cs
Lines 410 to 428 in b0eaace
internal static SqlServerValueGenerationStrategy GetValueGenerationStrategy( | |
this IReadOnlyProperty property, | |
in StoreObjectIdentifier storeObject, | |
ITypeMappingSource? typeMappingSource) | |
{ | |
var annotation = property.FindAnnotation(SqlServerAnnotationNames.ValueGenerationStrategy); | |
if (annotation != null) | |
{ | |
return (SqlServerValueGenerationStrategy?)annotation.Value ?? SqlServerValueGenerationStrategy.None; | |
} | |
var sharedTableRootProperty = property.FindSharedStoreObjectRootProperty(storeObject); | |
if (sharedTableRootProperty != null) | |
{ | |
return sharedTableRootProperty.GetValueGenerationStrategy(storeObject) | |
== SqlServerValueGenerationStrategy.IdentityColumn | |
&& !property.GetContainingForeignKeys().Any(fk => !fk.IsBaseLinking()) | |
? SqlServerValueGenerationStrategy.IdentityColumn | |
: SqlServerValueGenerationStrategy.None; |
As I understood, parameter typeMappingSource contains the hint for work.
This parameter was added in #23929
Why typeMappingSource does not passed in recursive call (line 424 )?
return sharedTableRootProperty.GetValueGenerationStrategy(storeObject)
I think, my question is addressed to @AndriySvyryd.
Thanks for answers.