public void Update(Group model) { var entity = Find(model.ID); db.Attach<Group>(entity); entity.Name=model.Name; entity.Description=model.Description; entity.Content=model.Content; db.Commit(); }
public Group Create(GroupViewModel model) { var entity = new Group(); entity.Name=model.Name; entity.Description=model.Description; entity.Content=model.Content; db.Add<Group>(entity); db.Commit(); return entity; }
public void Delete(Group model) { var target = Find(model.ID); db.Remove<Group>(target); db.Commit(); }
public void Create(Group model) { db.Add<Group>(model); db.Commit(); }