Is it possible to scaffold view from existing database in Entity Framework Core 2.0?
Something like command below:
Scaffold-DbContext "Server=xxx;Database=xxx; User Id=xxx; Password=xxx;"
Microsoft.EntityFrameworkCore.SqlServer
-OutputDir Models -Context TestStare
-Tables Osebe -Views View1 -Force
During installation, the EntityFramework NuGet package checks which database server is available. The NuGet package will then update the configuration file by setting the default database server that Code First uses when creating a connection by convention.
Install Entity FrameworkRight click on your project name and select Manage NuGet Packages. Go to Browse and Select Entity Framework then click Install button to install Entity Framework on your project.
From EF Core 3.0 it is possible to scaffold views and keyless entities Excerpt from Docs
Query types, which represent data that can be read from the database but not updated, have been renamed to keyless entity types. As they are an excellent fit for mapping database views in most scenarios, EF Core now automatically creates keyless entity types when reverse engineering database views.
No, it is not supported, currently in the Backlog: https://github.com/aspnet/EntityFrameworkCore/issues/1679
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With