private void DeleteSelf([Inject] IRoleDal dal) { using (BypassPropertyChecks) { dal.Delete(this.Id); } }
public EntityResult Delete(Role model) { try { if (_roleDal.Delete(model)) { return(new EntityResult("Başarılı", ResultState.Success)); } return(new EntityResult("Hata Oluştu", ResultState.Warning)); } catch (Exception ex) { return(new EntityResult("Database hatası " + ex.ToInnestException().Message, ResultState.Error)); } }
public bool Delete(int id) { var deleteObject = _roleDal.GetOne(x => x.id == id); if (deleteObject != null) { bool result = _roleDal.Delete(deleteObject); if (result) { return(true); } return(false); } return(false); }
public DataResponse Delete(Role entity) { var role = _RoleDal.Delete(entity); if (role == null) { return new DataResponse { Mesaj = "Aradiginiz Rol Bulunamadi", Tamamlandi = false } } ; return(new DataResponse { Data = role, Mesaj = "Rol Silindi", Tamamlandi = true }); } }
/// <summary> /// Deletes the specified item that contains the id. /// </summary> /// <param name="id"></param> /// <param name="errors"></param> /// <param name="context"></param> /// <returns></returns> public bool TryDelete(int id, List <IModelError> errors, IModelContext context = null) { var exists = Exists(id, context); if (!exists) { AddNotExistsError(errors); return(false); } try { changeHandler.BeforeDelete(id, context); dal.Delete(id, context); changeHandler.AfterDelete(id, context); } catch (Exception ex) { log.Exception(LogName, ex); throw new InvalidOperationException("Unable to delete IRoleDataModel", ex); } return(true); }
public void Delete(Role role) { _roleDal.Delete(role); }
public void Delete(int roleId) { _roleDal.Delete(new Role { Id = roleId }); }
/// <summary> /// 删除一条数据 /// </summary> public void Delete(int ID) { dal.Delete(ID); }
public void Delete(Role entity) { _roleDal.Delete(entity); }
public void Delete(int Id) { _roleDal.Delete(Id); }
public bool Delete(int id) { return(_roleDal.Delete(id)); }
public void Delete(int id) { _roleDal.Delete(id); }