EF Core Razor Pages and an MSSQL View
Hi Everyone,
i am trying to create an Page in Razor for an MSSQL View.
I have two tables shown in the Screenshot which are linked in the View.
The view as it self works fine in MSSQL.
No i created the Model Class for it
[Keyless]
public class MarketView
{
public long ItemID { get; }
public string Fullname { get; }
public decimal averagebuyPrice { get; }
public decimal averagesellPrice { get; }
public decimal maxsellPrice { get; }
public decimal minsellPrice { get; }
public decimal maxbuyPrice { get; }
public decimal minbuyPrice { get; }
public DateTime Actdate { get; }
}
No when i am trying to create an EF Page with it it says no Key Found how can i manage it that VS creates an page for it?
Thanks for your Help 😉
![](https://utfs.io/f/0d5aff89-98a5-42db-bdf0-cefd5c209262-4pl4mu.png)
![](https://utfs.io/f/46e14b98-1885-48b9-bb6b-1533bba5b61b-4pl4mu.png)
![](https://utfs.io/f/1c27db35-4adb-49a6-87e4-f5ce57c83122-4pl4mu.png)
![](https://utfs.io/f/5db98aa0-6f32-4f82-afc9-982800b0c625-4pl4mu.png)
2 Replies
Code generation in ASP is fairly limited. And since it's usually used to generate CRUD, while views only cover the R part of it, the generator can get confused
Just make the page manually
okay thanks i will try