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