'Scaffold-DbContext SQL database Views ? ASP NET CORE 6
I am new to .Net Core and I'd like to know scaffold EF support sql view like it supports sql table in .Net Core 6? If it supports which command will do? For tables,Scaffold-DbContext and is it same command?
Thank you very much in advance!
Solution 1:[1]
Scaffold-DbContext can scaffold both tables and views, Here is the Example:-
Scaffold-DbContext "Server=10.10.10.123;Database=Testdb; user id=sa; password=Sa1234" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context TestDBContext -Tables v_employee
Solution 2:[2]
Scaffold-DbContext will scaffold both tables and views
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dutt93 |
Solution 2 | ErikEJ |