0

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!

JewelJJ
  • 17
  • 2
  • 4
  • you can refer to this [link](https://stackoverflow.com/questions/60741838/scaffold-dbcontext-sql-views-asp-net-core-3-1). – Xinran Shen Mar 24 '22 at 08:15

2 Answers2

0

Scaffold-DbContext will scaffold both tables and views

ErikEJ
  • 40,951
  • 5
  • 75
  • 115
0

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

Dutt93
  • 118
  • 10