You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Muchiachio My code is like what you said above.
However, you still need to use the command dotnet ef migrate add migrate_name to generate snapshot files .
And I dot not want to use dotnet CLI tool. just want use C# code in my application start.
Is there any way to do it ?
Thanks !
I can imagine that the logic required to generate the migration procedure doesn't event exist inside EF Core itself, but inside that second NuGet package (so using it automatically may be hard?).
Maybe using Roslyn, one could compile it dynamically ... but then again, what would happen with the EfCore Migrations table ...
In my view, this feature request (if not already available!) should be directed to the Tools-package. Some method could be defined on the classes there. I read that the auto-migrate feature was not included by design, though, so don't count on it being implemented...
@Oger-Me Are you trying to implement automatic migrations (like we had in EF6) where no Migration class is scaffolded and stored in the project? Or is your goal to scaffold the Migration class without using the Add-Migration/dotnet ef migrations add command?
Activity
netcore-jroger commentedon Aug 2, 2016
@Muchiachio My code is like what you said above.
However, you still need to use the command
dotnet ef migrate add migrate_name
to generate snapshot files .And I dot not want to use dotnet CLI tool. just want use C# code in my application start.
Is there any way to do it ?
Thanks !
bjorn-ali-goransson commentedon Aug 2, 2016
I can imagine that the logic required to generate the migration procedure doesn't event exist inside EF Core itself, but inside that second NuGet package (so using it automatically may be hard?).
Maybe using Roslyn, one could compile it dynamically ... but then again, what would happen with the EfCore Migrations table ...
bjorn-ali-goransson commentedon Aug 2, 2016
In my view, this feature request (if not already available!) should be directed to the Tools-package. Some method could be defined on the classes there. I read that the auto-migrate feature was not included by design, though, so don't count on it being implemented...
bricelam commentedon Aug 9, 2016
@Oger-Me Are you trying to implement automatic migrations (like we had in EF6) where no
Migration
class is scaffolded and stored in the project? Or is your goal to scaffold theMigration
class without using theAdd-Migration
/dotnet ef migrations add
command?bricelam commentedon Aug 9, 2016
To generate a migrations file, the logic lives inside the
Microsoft.EntityFrameworkCore.Design
package:bricelam commentedon Aug 9, 2016
Implementing automatic migrations is a lot more involved, but I'd be happy to give you the high-level steps if your interested.
110 remaining items