示例#1
0
 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();
 }
示例#2
0
 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;
 }
示例#3
0
 public void Delete(Member model)
 {
     var target = Find(model.ID);
     db.Remove<Member>(target);
     db.Commit();
 }
示例#4
0
 public void Create(Member model)
 {
     db.Add<Member>(model);
     db.Commit();
 }