public void Update(Member model) { var target = Find(model.ID); db.Attach<Member>(target); target.Name = model.Name; target.Password = model.Password; target.GroupID = model.GroupID; db.Commit(); }
public Member Create(MemberViewModel model) { var entity = new Member(); entity.Name = model.Name; entity.Password = model.Password; entity.GroupID = model.GroupID; db.Add<Member>(entity); db.Commit(); return entity; }
public void Delete(Member model) { var target = Find(model.ID); db.Remove<Member>(target); db.Commit(); }
public void Create(Member model) { db.Add<Member>(model); db.Commit(); }