Add "customattribute" to entities
Posted: Tue 06 Oct 2020 10:57
Hi,
Is it possible to add a custom annotation to an entity using Entity Developer? What I mean by this is the following:
<EntityType Name="CartItem" customannotation:ClrType="EntityModel.CartItem">
or
<EntityType Name="CartItem" customannotation:ClrType="MyApp.CartItem, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
The reason I ask this is because we suffer from an Entity Framework issue:
`System.Data.Entity.Core.MetadataException: Schema specified is not valid. Errors:
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Translation'. `
More here: https://stackoverflow.com/questions/149 ... ith-ef-6-5
This error occurs because we use two separate data models in our application (both created with Entity Developer btw) and both contain an entity named `Translation` in this case.
To overcome this error we'd like to add the above `customannotation` as mentioned in the thread on Stackoverflow (see link above).
Is this even possible?
We use Entity Developer 6.6.894, Entity Framework 6.2.0 and SQL Server 2017 for the database.
Cheers,
Raymond
Is it possible to add a custom annotation to an entity using Entity Developer? What I mean by this is the following:
<EntityType Name="CartItem" customannotation:ClrType="EntityModel.CartItem">
or
<EntityType Name="CartItem" customannotation:ClrType="MyApp.CartItem, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
The reason I ask this is because we suffer from an Entity Framework issue:
`System.Data.Entity.Core.MetadataException: Schema specified is not valid. Errors:
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Translation'. `
More here: https://stackoverflow.com/questions/149 ... ith-ef-6-5
This error occurs because we use two separate data models in our application (both created with Entity Developer btw) and both contain an entity named `Translation` in this case.
To overcome this error we'd like to add the above `customannotation` as mentioned in the thread on Stackoverflow (see link above).
Is this even possible?
We use Entity Developer 6.6.894, Entity Framework 6.2.0 and SQL Server 2017 for the database.
Cheers,
Raymond