Why throw a exception of InvalidOprationException when I register two MetaModels to same a database?Because one MetaModel for web site,the other for web api.
You need to save the MetaModel to a separate variable for each different model even if they are for the same DB. Please post the code for how you are registering them.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
P.S. when I think back to the multiple metaModels I have registered of the same database they have always been different models, this may be a limitation of the MetaModel only a single reference to a data model?
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
Member
38 Points
160 Posts
Why throw a exception of InvalidOprationException when I register two MetaModels to same a datab...
May 13, 2016 09:00 AM|zzdfc|LINK
Why throw a exception of InvalidOprationException when I register two MetaModels to same a database?Because one MetaModel for web site,the other for web api.
None
0 Points
7 Posts
Re: Why throw a exception of InvalidOprationException when I register two MetaModels to same a d...
May 16, 2016 11:35 AM|huiling123|LINK
can you provide some related code about the issue.
All-Star
17916 Points
5681 Posts
MVP
Re: Why throw a exception of InvalidOprationException when I register two MetaModels to same a d...
May 16, 2016 12:37 PM|sjnaughton|LINK
You need to save the MetaModel to a separate variable for each different model even if they are for the same DB. Please post the code for how you are registering them.
Always seeking an elegant solution.
All-Star
17916 Points
5681 Posts
MVP
Re: Why throw a exception of InvalidOprationException when I register two MetaModels to same a d...
May 16, 2016 01:51 PM|sjnaughton|LINK
P.S. when I think back to the multiple metaModels I have registered of the same database they have always been different models, this may be a limitation of the MetaModel only a single reference to a data model?
Always seeking an elegant solution.