entity-framework-coreasp.net-core-2.2asp.net-core-scaffolding

How to scaffold views and stored procedures from SQL Server to ASP.NET Core 2.2 project?


I have an existing database in SQL Server that I need to connect to ASP.NET Core 2.2 project with EF Core. I scaffolded the models and the DbContext via the Scaffold-DbContext command in Package Manager Console. I can access all the data from the tables. However this didn't scaffold the procedures or the views.

This is a major obstacle to starting to use ASP.NET Core in our apps. Is there any way we could circumvent this? Can it be done in ASP.NET Core 2.2 or in a later version?


Solution

  • Stored procedure and view mapping is not currently supported in ef core scaffolding. You can track open issues respectively at 245 and 827.