The most ridiculous thing ever in Entity Framework
Schema specified is not valid. Errors: The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'TB_MyTable'. Previously found CLR type 'Namespace.NSOne.TB_MyTable', newly found CLR type 'Namespace.NSTwo.CIXModel.TB_MyTable'.
This comes about because I choose to group my tables logically by business functionality, e.g Payroll, Sales, MasterData, etc.. and thus create multiple DBContexts; rather than one humongous context with hundreds of tables, partitioning them aids with clarity and understanding. Unfortunately, due to whatever reason / excuse given by the EF framework team, the same table cannot appear in different contexts, even though the namespaces are different.. say what ??! So do namespaces mean anything at all ?
I've been using EF since approx version 4. i.e. from circa 2010. It is now 2019.. This is the most ridiculous thing ever left hanging with no resolution or a fix by the EF team... and now they've moved onto the next latest and greatest bs (ehhh sorry to the core fanatics out there lol, but I am happy with the full framework for now, seriously I don't need the cutdown xcross platform new toy, which provide no real value to me - i would see more value if this bug was fixed).
So dear fellow redditors and dotnet fanatics, have you come across this scenario before and how have you handled it? Can I somehow rename my Entities in the generated EDMX ?
0 comments:
Post a Comment