Generate the compiled model during build
AndriySvyryd opened this issue · 2 comments
This allows to make sure that the context is using an up-to-date model, most useful for Release builds.
To avoid dependency cycles the compiled model needs to be compiled in an assembly separate from the startup assembly
I second this. I'm seeing great improvements in startup times for a project with a large model, but I keep forgetting to run ef optimize and am worried other devs on the project will as well. I'd envision this task would look at the files associated with the DBContext, then the ones associated with the model. If any associated with the DbContext are newer than the ones associated with the model, run dotnet ef optimize.
We need this for EF Core to run in Native AOT mode. We will need some way to automatically build compiled model and transparently shim in for Native AOT DX.