public IUserType Read(Guid id) { using (FilkioCrmContext db = new FilkioCrmContext()) { UserTypeEntity itemToRead = db.UserTypes.Where(i => i.Id == id).FirstOrDefault(); return(itemToRead); } }
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(); } }
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(); } }
public void Create(IUserType item) { using (FilkioCrmContext db = new FilkioCrmContext()) { UserTypeEntity itemToAdd = new UserTypeEntity(item); db.UserTypes.Add(itemToAdd); db.SaveChanges(); } }