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
DB scaffold CLI Removes DBSET<t> (dbquery<t>) #18944
Labels
Comments
You are a bit unclear, but with EF Core 3, you can override the OnModelCreatingPartial partial method |
How? Because the on model creating auto generated by the db scaffold CLI is already an override? Can you have 2 overrides? Will it run both overrides?
Logan
On Nov 16, 2019, at 5:08 PM, Erik Ejlskov Jensen <notifications@github.com> wrote:
You are a bit unclear, but with EF Core 3, you can override the OnModelCreatingPartial partial method
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#18944>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEYSEOEGXMNJ2HQV7KB3J3DQUBVNRANCNFSM4JOGD3LA>.
|
Have a close look at the last lines of the generated DbContext |
I did look at it, not sure what your subtly inferring? Can you be more direct?
Logan
On Nov 16, 2019, at 5:50 PM, Erik Ejlskov Jensen <notifications@github.com> wrote:
Have a close look at the last lines of the generated DbContext
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#18944>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEYSEOAQSTZCTMOHAU3TO4TQUB2KVANCNFSM4JOGD3LA>.
|
Something like this: ErikEJ/EFCorePowerTools#300 (comment) |
ajcvickers
added
closed-no-further-action
The issue is closed and no further action is planned.
and removed
type-bug
labels
Nov 18, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Since the Dbscaffold CLI replaces dbcontext c# file each time. In order to use ef cores new dbSet (the new dbquery) you have to put into this (auto wiped out by the CLI) dbcontext file as a.HasNoKey() item.
In efc2 the dbquery we kept it in a partial class so it wouldn't get over written by the scaffold. Since we can't put dbSets in a different c# file because we need to add hasnoKey() in onmodelbuilding event (which gets over written by the scaffold), we have to stay on 2.0
Would really like to upgrade to EF core 3.0 but since they deprecated DBquery into something new that breaks db scaffolding for us we can't.
The only nuGet we haven’t updated in our core3.0 build is this efcore3.0 one. 😅
EF Core version: 3.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: NET Core 3.0
Operating system: win10 x64
IDE: Visual Studio 2019 16.3.8
The text was updated successfully, but these errors were encountered: