public void Update(RelationCate model) { var entity = Find(model.ID); db.Attach<RelationCate>(entity); entity.CateName=model.CateName; entity.PID=model.PID; entity.Code=model.Code; entity.Level=model.Level; entity.OrderIndex=model.OrderIndex; db.Commit(); }
public RelationCate Create(RelationCateViewModel model) { var entity = new RelationCate(); entity.CateName=model.CateName; entity.PID=model.PID; entity.Code=model.Code; entity.Level=model.Level; entity.OrderIndex=model.OrderIndex; db.Add<RelationCate>(entity); db.Commit(); return entity; }
public void Delete(RelationCate model) { var target = Find(model.ID); db.Remove<RelationCate>(target); db.Commit(); }
public void Create(RelationCate model) { db.Add<RelationCate>(model); db.Commit(); }