Skip to content
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

Scaffolded db context's OnModelCreating doesn't call base class #14111

Closed
neville-nazerane opened this issue Dec 7, 2018 · 1 comment
Closed

Comments

@neville-nazerane
Copy link

When scaffolding an existing database into an mvc project, I noticed the OnModelCreating function doesn't contain the line base.OnModelCreating(modelBuilder) to call the base function. It seems to create confusions such as this: https://stackoverflow.com/q/53657924/991609

@ajcvickers
Copy link
Member

@neville-nazerane This is by-design. OnModelCreating is a "pure" template method, so there is no need to call the DbContext implementation of it. If you derive from another type that may have code there, then calling it on that type usually makes sense, but that's a different scenario.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants