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