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 😉
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