I use a EF code first to create my system.
Recently I want to use it to map the view on SQL server , but it has problems
I create the model as the view name V_InProcessRMForm
This view is from the other dept. I have no right to change it and needn’t .All I want is map the data from this view and show on the web page .
public class DmsEntity : DbContext
{
public DbSet<V_InProcessRMForm> V_InProcessRMForm { get; set; }
}
public class V_InProcessRMForm
{
[Key]
public string Docid { get; set; }
public string FormNm { get; set; }
public string ChangeDocId { get; set; }
public string Stats { get; set; }
public string CancelReason { get; set; }
}
when the code run here it display : you have no CREATE TABLE right ont it.
DmsEntity entity = new DmsEntity();
var l = from a in entity.V_InProcessRMForm
Has anyone can help me ? thanks a lot .
Finally I change the way , I use the normal EF to resolved this problem.
That generates the edmx file and I can use it accesses the view data now.
Thanks a lot.