I'm using C# Entity Framework 6 and I have a database with multiple schemas, in those schemas I have tables with the same names. For example:
I have a single project for all of my database objects with this structure:
Project Name = Storm.API.Data
In this project I have folders with the schema names: "Availability", "Rates".
In each folder I have the proper 'edmx' file.
When I run my project I'm getting this error:
Schema specified is not valid. Errors:
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM
type 'Hotel'. Previously found CLR type 'Storm.API.Data.Rates.Hotel',
newly found CLR type 'Storm.API.Data.Availability.Hotel'.
The only solution I came up with is to separate the schemas to different project, but since I have more than 2 schemas I don't want to create so many project just for that.
Is there another solution that will enable me to have all schemas under the same project without this error ?
You can:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With