public void AddCategory(WorkOut_Category item) { try { WorkoutDBEntities db = new WorkoutDBEntities(); db.WorkOut_Category.Add(item); db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public WorkOut_Category Get(int id) { WorkOut_Category objWork = null; try { WorkoutDBEntities db = new WorkoutDBEntities(); objWork = (from obj in db.WorkOut_Category where obj.Category_id == id select obj).First(); } catch (Exception ex) { throw ex; } return(objWork); }
public void EditCategory(WorkOut_Category item) { try { WorkoutDBEntities db = new WorkoutDBEntities(); var ObjCategory = (from obj in db.WorkOut_Category where obj.Category_id == item.Category_id select obj).First(); ObjCategory.Category_Name = item.Category_Name; db.SaveChanges(); } catch (Exception ex) { throw ex; } }