예제 #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();
     }
 }