Yampolka
asked on
How to populate Entity from stored Proc Entity
I created Entity from database Table Category
Auto generated code is:
public partial class StoreDBEntities : DbContext
{
public StoreDBEntities()
: base("name=StoreDBEntities ")
{
}
protected override void OnModelCreating(DbModelBui lder modelBuilder)
{
throw new UnintentionalCodeFirstExce ption();
}
public DbSet<Category> Categories { get; set; }
}
Now when I write the following code all records are loaded into the table which I do not want to happen
StoreDBEntities ss = new StoreDBEntities();
var cc = ss.Categories;
List<Category> lc = cc.ToList();
1)How to populate entity from stored proc ?
2 How to save entity using stored proc?
Auto generated code is:
public partial class StoreDBEntities : DbContext
{
public StoreDBEntities()
: base("name=StoreDBEntities
{
}
protected override void OnModelCreating(DbModelBui
{
throw new UnintentionalCodeFirstExce
}
public DbSet<Category> Categories { get; set; }
}
Now when I write the following code all records are loaded into the table which I do not want to happen
StoreDBEntities ss = new StoreDBEntities();
var cc = ss.Categories;
List<Category> lc = cc.ToList();
1)How to populate entity from stored proc ?
2 How to save entity using stored proc?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.