private void Validate(T obj, AbstractValidator <T> validator) { if (obj != null) { validator.ValidateAndThrow(obj); } }
/// <summary> /// Validate the model and throw an exception if it fails. /// </summary> public void ValidateAndThrow() { if (_validator != null) { _validator.ValidateAndThrow <T>(this as T); } }
protected override async Task HandleCore(UpdateCommitmentAgreementCommand command) { if (command.Caller.CallerType == CallerType.Employer) { throw new InvalidOperationException( "Method obsolete for Employer: Cohort Send functionality now handled in v2 API."); } _validator.ValidateAndThrow(command); LogMessage(command); var commitment = await _commitmentRepository.GetCommitmentById(command.CommitmentId); CheckCommitmentCanBeUpdated(command, commitment); var userInfo = new UserInfo { UserDisplayName = command.LastUpdatedByName, UserEmail = command.LastUpdatedByEmail, UserId = command.UserId }; if (commitment.ChangeOfPartyRequestId.HasValue) { await _v2EventsPublisher.PublishCohortWithChangeOfPartyUpdatedEvent(command.CommitmentId, userInfo); } await _v2EventsPublisher.SendProviderSendCohortCommand(command.CommitmentId, command.Message, userInfo); }
private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception("Registros não detectados!"); } validator.ValidateAndThrow(obj); }
private void Validate(Friend obj, AbstractValidator <Friend> validator) { if (obj == null) { throw new Exception("Registros não localizados."); } validator.ValidateAndThrow(obj); }
/// <summary> /// Function to validate object /// </summary> /// <param name="obj"></param> /// <param name="validator"></param> private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception("The Records not found!"); } validator.ValidateAndThrow(obj); }
protected void Validate(T entity, AbstractValidator <T> validator) { if (entity == null) { throw new AppException(MessagesAPI.OBJECT_INVALID); } validator.ValidateAndThrow(entity); }
internal void Validate <T>(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception("Objeto Inválido!"); } validator.ValidateAndThrow(obj); }
private void Validate(TEntity obj, AbstractValidator <TEntity> validator) { if (obj == null) { throw new Exception("Dados nulos!"); } validator.ValidateAndThrow(obj); }
private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception($"data can't be null."); } validator.ValidateAndThrow(obj); }
private static void Validate(TEntity entity, AbstractValidator <TEntity> validaor) { if (entity == null) { throw new ArgumentNullException(nameof(entity), "Registros não detectados!"); } validaor.ValidateAndThrow(entity); }
private void Validate(User user, AbstractValidator <User> validator) { if (user == null) { throw new Exception("Registros não detectados!"); } validator.ValidateAndThrow(user); }
private void Validate(Empresa empresa, AbstractValidator <Empresa> validator) { if (empresa == null) { throw new ArgumentNullException("Objeto não encontrado"); } validator.ValidateAndThrow(empresa); }
private void Validate(UserInfo obj, AbstractValidator <UserInfo> validator) { if (obj == null) { throw new Exception("records not found, Please provide valide input."); } validator.ValidateAndThrow(obj); }
private void Validate(T entity, AbstractValidator <T> validator) { if (entity == null) { throw new Exception("Validating error - null entity"); } validator.ValidateAndThrow(entity); }
private void Validate(TEntity model, AbstractValidator <TEntity> validator) { if (model == null) { throw new Exception("Registros não detectados!"); } validator.ValidateAndThrow(model); }
private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new ArgumentException("Uninformed records!"); } validator.ValidateAndThrow(obj); }
private void Validate(Vehicle entity, AbstractValidator <Vehicle> validator) { if (entity == null) { throw new Exception("Registro não detectado!"); } validator.ValidateAndThrow(entity); }
private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception("None register!"); } validator.ValidateAndThrow(obj); }
private void Validate(Category category, AbstractValidator <Category> validator) { if (category == null) { throw new Exception("Registros não detectados!"); } validator.ValidateAndThrow(category); }
public void Validate(TEntity obj, AbstractValidator <TEntity> validator) { if (obj == null) { throw new Exception("Registros não detectados!"); } validator.ValidateAndThrow(obj); }
private void Validate(Product obj, AbstractValidator <Product> validator) { if (obj == null) { throw new Exception("records not found!"); } validator.ValidateAndThrow(obj); }
private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception("objeto nulo."); } validator.ValidateAndThrow(obj); }
private void Validate(T obj, AbstractValidator <T> validator, string ruleSet = "*") { if (obj == null) { throw new Exception("No detected registers!"); } validator.ValidateAndThrow(obj, ruleSet); }
private void Validate(T entity, AbstractValidator <T> validator) { if (entity == null) { throw new Exception("Registros não detectados!"); } validator.ValidateAndThrow(entity); }
private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception("Not found Data"); } validator.ValidateAndThrow(obj); }
private void Validate(T entity, AbstractValidator <T> validator) { if (entity == null) { throw new Exception("Records not found!"); } validator.ValidateAndThrow(entity); }
public static bool TryValidate <T>(this AbstractValidator <T> validator, T value) { try { validator.ValidateAndThrow(value); return(true); } catch { return(false); } }
private void Validate(T obj, AbstractValidator <T> validator) { if (obj == null) { throw new Exception("Resgistros não encontrados"); } validator.ValidateAndThrow(obj); }
private void Validate(Fornecedor fornecedor, AbstractValidator <Fornecedor> validator) { if (fornecedor == null) { throw new ArgumentNullException("Objeto não encontrado"); } validator.ValidateAndThrow(fornecedor); }