New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i cancel the asp.net core field plus "s" behavior when I execute complex query #33693
Comments
Hard to say what is happening without a repro, but it could just be that you have a |
!!!!!!!!! |
@LZzccc222 A couple of things. First, it's notoriously difficult to customize the ASP.NET Core Identity model. It uses a lot of quite obscure mappings. See Identity model customization in ASP.NET Core. I wrote the doc on it, and I still have to refer back to the doc if I need to do it. That being said, this may not be relevant if you're just trying to reverse engineer you own model. Second, the documentation for mapping many-to-many relationships is here: Many-to-many. It looks like you're going to need Many-to-many with navigations and changed foreign keys. |
@ajcvickers I get what you mean.Thanks for your resolving,I have resolved this problem by referencing efcore doc. |
this is my table including "role","user","roleUser"
I use dbfirst method to generate my model entity,I already predict that the generated models don't include skip navigation,,for example,my "User.cs" model doesn't include the Roles Navigation but RoleUsers Navigation,I guess the reason is that I create table "roleUser" add column "id",it doesn't matter for me.
The key is that after I add Roles Navigations mannunaly,I want to get the user related role data by roles navagation directyly,the sql generated by efcore seems that always plus "s" when executed correlated query,but my database field doesn't plus 's',which results the sql execution error.it bothers me very much!!
this is my fluentApi settings about RoleUser.
thanks for resolving my problem,it's mergency!!
The text was updated successfully, but these errors were encountered: