Details
-
Bug
-
Resolution: Duplicate
-
Unknown
-
None
-
Public Preview 1
-
None
Description
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"); |
Attachments
Issue Links
- duplicates
-
EF-42 Shadow properties
-
- Backlog
-