Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 6bbc102

Browse files
committed
Improved IsIdentity calculation.
1 parent 0aa6664 commit 6bbc102

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ public T[] GetAttributes<T>(Type type, MemberInfo memberInfo, bool inherit = tru
152152
var isIdentity = prop.GetAnnotations()
153153
.Any(a => a.Name.EndsWith(":ValueGenerationStrategy") && a.Value?.ToString() == "IdentityColumn");
154154

155+
if (!isIdentity && isPrimaryKey)
156+
{
157+
isIdentity = prop.ValueGenerated == ValueGenerated.OnAdd;
158+
}
159+
155160
return new T[]{(T)(Attribute) new ColumnAttribute
156161
{
157162
Name = prop.GetColumnName(),

0 commit comments

Comments
 (0)