-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Server Views support #9854
Comments
Duplicate of #1679 Till then the approach you mentioned is the way to get scaffolding to generate entity type for views. |
@smitpatel I do not see the point, tables can have missing PKs as well. |
When I follow the advice of the thread starter to use tables to force the scaffolding wizard to generate the entity classes, I found that choosing a name beginning with double underscores like "__Customer" for the "template table" leads to correctly labeled Entityname "Customer", all you have to change is the referenced table name, which in this case can be done by cutting all "__" |
It's 2019. Is there still no way for SQL Server Views to be generated? If this is the case, it would be a major setback for our plans to start using ASP.NET Core |
In order to have entities generated for my SQL Server database views I have to:
select top 0 * into dbo.ItemsView2 from dbo.ItemsView
alter table dbo.ItemsView2 add constraint PK_ItemsView2 primary key nonclustered (ItemId)
Scaffold-DbContext ...
drop table dbo.ItemsView2
The question: is there a better way? Am I missing something?
The text was updated successfully, but these errors were encountered: