public Category Editcategory(int catID) { using (var db = new EStoreContext()) { return(db.categories.Find(catID)); } }
public List <Category> Getcategory() { using (var db = new EStoreContext()) { return(db.categories.ToList()); } }
public void Updatecategory(Category category) { using (var db = new EStoreContext()) { db.Entry(category).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public void Savecategory(Category category) { using (var db = new EStoreContext()) { db.categories.Add(category); db.SaveChanges(); } }
public void Deletecategory(int ID) { using (var db = new EStoreContext()) { var catData = db.categories.Find(ID); db.categories.Remove(catData); db.SaveChanges(); } }
//Landing Page for Each Store in Que public static TemplateThemeIndex GetEstoreIndex() { EStoreContext db = new EStoreContext(); //ApplicationDbContext app_Db = new ApplicationDbContext(); TemplateThemeIndex setup = new TemplateThemeIndex(); var Title = db.SEOModels.Where(x => x.Id == x.Id); setup.Title = Title.ToString(); return(setup); }