Link to home
Start Free TrialLog in
Avatar of Yampolka
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(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }
   
        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
Avatar of Camillia
Camillia
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial