示例#1
0
 public IUserType Read(Guid id)
 {
     using (FilkioCrmContext db = new FilkioCrmContext())
     {
         UserTypeEntity itemToRead = db.UserTypes.Where(i => i.Id == id).FirstOrDefault();
         return(itemToRead);
     }
 }
示例#2
0
 public void Update(IUserType item, Guid id)
 {
     using (FilkioCrmContext db = new FilkioCrmContext())
     {
         UserTypeEntity itemToUpdate = db.UserTypes.Where(i => i.Id == id).FirstOrDefault();
         itemToUpdate.Update(item);
         db.SaveChanges();
     }
 }
示例#3
0
 public void Delete(Guid id)
 {
     using (FilkioCrmContext db = new FilkioCrmContext())
     {
         UserTypeEntity itemToDelete = db.UserTypes.Where(i => i.Id == id).FirstOrDefault();
         db.Remove(itemToDelete);
         db.SaveChanges();
     }
 }
示例#4
0
 public void Create(IUserType item)
 {
     using (FilkioCrmContext db = new FilkioCrmContext())
     {
         UserTypeEntity itemToAdd = new UserTypeEntity(item);
         db.UserTypes.Add(itemToAdd);
         db.SaveChanges();
     }
 }