-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Unknown
-
None
-
Affects Version/s: Public Preview 1
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
If an Entity is defined without an Id or _id property, and a Shadow Property is defined as part of the OnModelCreating method
modelBuilder.Entity<ModelType>().Property<ObjectId>("Id");
System.NotSupportedException is thrown at runtime
System.NotSupportedException: 'Unsupported shadow property 'TempId' identified on entity type 'ModelType'.'
It can be desirable to have the entity identifier implemented as a shadow property to enable models to be easily ported between SqlServer and MongoDB, for example.
For MongoDB
modelBuilder.Entity<ModelType>().Property<ObjectId>("Id");
For SqlServer
modelBuilder.Entity<ModelType>().Property<uint>("Id");
- duplicates
-
EF-42 Shadow properties
-
- Closed
-