-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fully qualified attributes #27196
Comments
I have a similar, but different issue when using Optimize-DbContext. I have a database table (again that I can't change) that's called DayOfWeek. When the compiled models are generated they aren't using fully qualified class names, so I'm getting an error when compiling saying: |
@ajcvickers Thank you for pointing me to those, I did some searches and couldn't find anything, but I now realize I think I only searched open issues, assuming this wasn't resolved. Unfortunately none of those issues have any fixes that I can use for 6.0 but I'll close this question as it's been answered. |
I'm using the Scaffold-DbContext command to reverse-engineer an existing database. I have used this since EF Core 3. In EF Core 6 I'm starting to have a problem with this line:
it needs to be this, for it to be correct and compile:
Otherwise I'm getting this error:
error CS0120: An object reference is required for the non-static field, method, or property 'Role.User'
My question is, is there an option to fully-qualify these attributes, or is there a better way to resolve this issue? I can't change the database structure, and I need to be able to re-generate the scaffolding whenever the database is changed, hopefully without manually changing this file every time.
The text was updated successfully, but these errors were encountered: