public Service(IStorage storage, IValidatorFactory validatorFactory) { _storage = storage; _validatorFactory = validatorFactory; _mapper = new MapperConfiguration(cfg => { cfg.AddProfile<AutoMapperProfile>(); }).CreateMapper(); }
public AccountCreator(IAuthorizationService authorizationService, IValidatorFactory validatorFactory, IAccountRepository accountRepository, ICryptographyService cryptographyService, IEmailService emailService, ISettingsProvider settingsProvider) { _authorizationService = authorizationService; _validatorFactory = validatorFactory; _accountRepository = accountRepository; _cryptographyService = cryptographyService; _emailService = emailService; }
public Service(IValidatorFactory validatorFactory) { _assembley = Assembly.Load("ServiceArch.DataProviders"); _validatorFactory = validatorFactory; _mapper = new MapperConfiguration(cfg => { cfg.AddProfile<TransferObjects.AutoMapperProfile>(); }).CreateMapper(); }
public AccountService(IAccountRepository accountRepository, IAuthorizationService authorizationService, ICryptographyService cryptographyService, IEmailService emailService, IValidatorFactory validatorFactory) { _accountRepository = accountRepository; _authorizationService = authorizationService; _cryptographyService = cryptographyService; _emailService = emailService; _validatorFactory = validatorFactory; }
public IModelValidatorFluentBuilder UseFactory(IObjectFactory objectFactory) { if (objectFactory == null) { throw new ArgumentNullException(nameof(objectFactory)); } ValidatorFactory = new ValidatorFactory(objectFactory); return this; }
protected override void Context() { AuthorizationService = MockRepository.GenerateStub<IAuthorizationService>(); ValidatorFactory = MockRepository.GenerateStub<IValidatorFactory>(); AccountRepository = MockRepository.GenerateStub<IAccountRepository>(); CryptographyService = MockRepository.GenerateStub<ICryptographyService>(); EmailService = MockRepository.GenerateStub<IEmailService>(); SettingsProvider = MockRepository.GenerateStub<ISettingsProvider>(); AccountService = new AccountService(AccountRepository, AuthorizationService, CryptographyService, EmailService, ValidatorFactory); }
protected override void Context() { AuthorizationService = MockRepository.GenerateStub<IAuthorizationService>(); CreateCustomerRequestValidator = MockRepository.GenerateStub<CreateCustomerRequestValidator>(); ValidatorFactory = MockRepository.GenerateStub<IValidatorFactory>(); ValidatorFactory.Stub(x => x.GetValidator<CreateCustomerRequest>()) .Return(CreateCustomerRequestValidator); CustomerRepository = MockRepository.GenerateStub<ICustomerRepository>(); CustomerCreator = new CustomerCreator(AuthorizationService, CreateCustomerRequestValidator, CustomerRepository); }
public CustomerController(ILogger logger, IAuthorizationService authorizationService, IValidatorFactory validatorFactory, ICustomerRepository customerRepository, IMappingEngine mappingEngine, ICustomerCreator customerCreator, IAccountRepository accountRepository) { _authorizationService = authorizationService; _validatorFactory = validatorFactory; _customerRepository = customerRepository; _mappingEngine = mappingEngine; _customerCreator = customerCreator; _accountRepository = accountRepository; _logger = logger; }
public ValidationCommandInterceptor() { _validatorFactory = new ValidatorFactory(); }
public LaboModelValidatorProvider(IValidatorFactory validatorFactory = null) { AddImplicitRequiredAttributeForValueTypes = true; ValidatorFactory = validatorFactory ?? new DefaultEntityValidatorFactory(); m_ValidationTransformerManager = ValidatorSettings.ValidationTransformerManager; }
public ConventionalModelMetadataProvider(IValidatorFactory factory) { this.factory = factory; }
public FluentValidationModelValidatorProvider(IValidatorFactory validatorFactory) { AddImplicitRequiredValidator = true; this.validatorFactory = validatorFactory; }
public DataErrorInfoBehavior(IValidatorFactory factory) { this.factory = factory; }
public GenreServiceBuilder WithDefaultFakeValidator() { IValidatorFactory _validatorFactory = A.Fake<IValidatorFactory>(); _validator = _validatorFactory; return this; }
public PhoneCall(Entity entity, ICrmService crm, IValidatorFactory validatorFactory) : base(entity, crm, validatorFactory) { }
public ValidationBehavior(IValidatorFactory validationFactory) { _validationFactory = validationFactory; }
public GenreService(IUnitOfWork unitOfWork, IValidatorFactory validatorFactory, ILogger logger) { _unitOfWork = unitOfWork; _logger = logger; _getDeleteGenreValidator = validatorFactory.GetValidator <GetDeleteGenreInput>(); }
public CellsValueValidator(IValidatorFactory validatorFactory) { this.validatorFactory = validatorFactory; }
public TestMasterService(ITestMasterRepository testMasterRepository, IUnitOfWork unitOfWork, IValidatorFactory validatorFactory) { this.validatorFactory = validatorFactory; this.testMasterRepository = testMasterRepository; this.unitOfWork = unitOfWork; }
public ParseImdbMovieAsyncCommandHandler(IValidatorFactory validatorFactory, FilmCrawlerDatabaseContext dbContext) : base(validatorFactory) { _dbContext = dbContext; }
public static bool TryValidate(this IValidatable validatable, out ValidationResult validationResult, IValidatorFactory validatorFactory = null, IServiceProvider serviceProvider = null) { validationResult = validatable.Validate(validatorFactory, serviceProvider); return(validationResult.IsValid); }
public ValidateCommandInterceptor(IValidatorFactory validatorFactory = null) { _factory = validatorFactory ?? new AttributedValidatorFactory(); }
public EditProjectValidatorFactory(IValidatorFactory fac) : base(fac) { }
public LabelRequiredTagHelper(IHtmlGenerator generator, IValidatorFactory factory) : base(generator) { _factory = factory; }
public RegisterModelBinder(ModelBinderDictionary modelbinders, IValidatorFactory validationFactory) { _modelbinders = modelbinders; _validationFactory = validationFactory; }
public static async Task <ValidationResult> ValidateAsync(this IValidatable validatable, IValidatorFactory validatorFactory = null, IServiceProvider serviceProvider = null, bool throwOnNoValidatorFound = false, bool throwOnValidationError = false) { if (validatable is null) { throw new ArgumentNullException(nameof(validatable)); } var validators = (validatorFactory ?? ValidatorFactory.DefaultFactory).GetValidators(validatable.GetType(), serviceProvider); if (validators.Any()) { var validationTasks = validators .Select(validator => validator.ValidateAsync(validatable)); var validationResults = await Task .WhenAll(validationTasks) .ConfigureAwait(false); var validationResult = validationResults .MergeValidationResults(); if (!validationResult.IsValid && throwOnValidationError) { throw validationResult.ToException(); } return(validationResult); } if (throwOnNoValidatorFound) { throw new NotSupportedException($"Validation of type {validatable.GetType()} is not supported"); } return(new ValidationResult()); }
public PlatformTypeService(IUnitOfWork unitOfWork, IValidatorFactory validatorFactory, ILogger logger) { _unitOfWork = unitOfWork; _logger = logger; _getDeletePlatformTypeValidator = validatorFactory.GetValidator <GetDeletePlatformTypeInput>(); }
public GearboxCommandFunctionality(IUnitOfWork unitOfWork, IMapperFactory mapperFactory, IGenericWriteRepository writeRepository, IValidatorFactory validatorFactory) : base(unitOfWork, mapperFactory, writeRepository, validatorFactory) { }
private IValidator BuildCollectionValidator(string prefix, ModelMetadata collectionMetadata, IValidatorFactory validatorFactory) { var elementValidator = validatorFactory.GetValidator(collectionMetadata.ElementType); if (elementValidator == null) { return(null); } var type = typeof(MvcCollectionValidator <>).MakeGenericType(collectionMetadata.ElementType); var validator = (IValidator)Activator.CreateInstance(type, elementValidator, prefix); return(validator); }
public ValidatorBehavior(IValidatorFactory validatorFactory) { this.validatorFactory = validatorFactory; }
public ValidationMessageMutator(IValidatorFactory validatorFactory) { _validatorFactory = validatorFactory; }
public AuthService(IUnitOfWork unitOfWork, IValidatorFactory validatorFactory) : base(unitOfWork, validatorFactory) { }
public FluentValidationModelValidatorProvider(IValidatorFactory validatorFactory) { ValidatorFactory = validatorFactory; }
public LaboModelValidatorProvider(IValidatorFactory validatorFactory = null) { AddImplicitRequiredAttributeForValueTypes = true; ValidatorFactory = validatorFactory ?? new DefaultEntityValidatorFactory(); m_ValidationTransformerManager = ValidatorSettings.ValidationTransformerManager; }
public ValidationCommandInterceptor(IValidatorFactory validatorFactory) { _validatorFactory = validatorFactory; }
public CustomModelMetadataProvider(IValidatorFactory factory) { _factory = factory; }
public FluentValidationModelValidatorProvider(IValidatorFactory validatorFactory = null) { ValidatorFactory = validatorFactory ?? new AttributedValidatorFactory(); }
/// <summary> /// Creates a validator for the specified model type. /// </summary> /// <typeparam name="T">The type of the model to validate.</typeparam> /// <param name="factory">The <see cref="IValidatorFactory"/>.</param> /// <returns>A new instance of <see cref="IValidator{T}"/>.</returns> /// <exception cref="ArgumentNullException">Argument <paramref name="factory"/> must not be <c>null</c>.</exception> public static IValidator <T> CreateValidator <T>(this IValidatorFactory factory) { return(new Validator <T>(factory)); }
public ValidationMiddleware(ILogger <Program> logger, IValidatorFactory validatorFactory) { _logger = logger; _validatorFactory = validatorFactory; }
public FluentValidationViewOptionsSetup(IValidatorFactory factory, Action <FluentValidationClientModelValidatorProvider> action) { _factory = factory; _action = action; }
/// <summary> /// Configures the labo model validator provider and adds to the mvc model validator providers. /// </summary> /// <param name="validatorFactory">The validator factory.</param> /// <param name="configurationAction">The configuration action.</param> public static void Configure(IValidatorFactory validatorFactory = null, Action<LaboModelValidatorProvider> configurationAction = null) { configurationAction = configurationAction ?? delegate { }; LaboModelValidatorProvider provider = new LaboModelValidatorProvider(validatorFactory); configurationAction(provider); DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false; ModelValidatorProviders.Providers.Add(provider); }
public ExtendedFluentValidationModelValidatorProvider(IValidatorFactory validatorFactory) { this.validatorFactory = validatorFactory; }
public EditCommentValidatorFactory(IValidatorFactory validatorFactory) : base(validatorFactory) { }
public FluentValidationModelMetadataProvider(IValidatorFactory factory) { this.factory = factory; }
public FluentValidationModelMetadataProvider(IValidatorFactory factory) { this.factory = factory; }
public CommandHandler(IDbContextScopeFactory scopeFactory, IValidatorFactory validatorFactory) { _scopeFactory = scopeFactory; _validatorFactory = validatorFactory; }
public FluentValidationModelBinder(IValidatorFactory validatorFactory) : base(validatorFactory, new IgnoreDataAnnotationsModelBinder()) { }
public ApplicationPersistenceManager(ApplicationDbContext dbContext, IHttpContextAccessor accessor, IValidatorFactory factory, IStringLocalizer <Global> l) : base(dbContext, accessor, factory, l) { }
public FluentValidationModelBinderDecorator(IValidatorFactory validatorFactory, IModelBinder wrappedBinder) { this.validatorFactory = validatorFactory; this.wrappedBinder = wrappedBinder; }
public EventStore(IStore store, IValidatorFactory validationFactory) { _store = store; _validationFactory = validationFactory; }
public DynamicValidationModelBinder(IValidatorFactory validatorFactory) { Argument.ExpectNotNull(() => validatorFactory); _validatorFactory = validatorFactory; }
public ValidationEngine(IPackageBinary packageBinary, IDerivationStrategyFactory derivationStrategyFactory, IMerkleStrategyFactory merkleStrategyFactory, IHashAlgorithmFactory hashAlgorithmFactory, TrustSchemaValidationOptions options, IValidatorFactory validatorFactory) { _packageBinary = packageBinary; _derivationStrategyFactory = derivationStrategyFactory; _merkleStrategyFactory = merkleStrategyFactory; _hashAlgorithmFactory = hashAlgorithmFactory; _options = options; _validatorFactory = validatorFactory; }
public FluentValidationModelBinder(IValidatorFactory validatorFactory) : base(validatorFactory, new DefaultModelBinder()) { }
public PackageSchemaValidator(IDerivationStrategyFactory derivationServiceFactory, IMerkleStrategyFactory merkleStrategyFactory, IHashAlgorithmFactory hashAlgorithmFactory, IPackageBinary packageBinary, IValidatorFactory validatorFactory) { _derivationServiceFactory = derivationServiceFactory; _merkleStrategyFactory = merkleStrategyFactory; _hashAlgorithmFactory = hashAlgorithmFactory; _packageBinary = packageBinary; _validatorFactory = validatorFactory; }
/// <summary>Initializes a new instance of the FluentValidation.Mvc.FluentValidationModelValidatorProvider class.</summary> /// /// <param name="validatorFactory">The validator factory.</param> public FluentValidationModelValidatorProvider(IValidatorFactory validatorFactory = null) { AddImplicitRequiredValidator = true; ValidatorFactory = validatorFactory ?? new AttributedValidatorFactory(); }
public ValidationBusinessRule(IValidatorFactory validatorFactory, IApiResultService apiResultService) { this.validatorFactory = validatorFactory; this.apiResultService = apiResultService; }
public ChoosePasswordViewModel(IValidatorFactory validatorFactory) { this.validatorFactory = validatorFactory; }
/* * private IModelValidatorProvider GetModelValidatorProvider(IValidatorFactory validatorFactory, CustomizeValidatorAttribute customizations) { * var modelValidatorProvider = ImplicitlyValidateChildProperties ? new FluentValidationModelValidatorProvider(validatorFactory, customizations, _validatorProvider) : (IModelValidatorProvider) _validatorProvider; * return modelValidatorProvider; * } */ protected virtual void RunDefaultValidation(ActionContext actionContext, IModelValidatorProvider validatorProvider, ValidationStateDictionary validationState, string prefix, object model, ModelMetadata metadata, bool implicitlyValidateChildPropertiesUsingFluentValidation, IValidatorFactory factory, CustomizeValidatorAttribute customizations) { ValidationVisitor visitor; // if (ImplicitlyValidateChildProperties) { // visitor = new CustomValidationVisitor(actionContext, validatorProvider, _validatorCache, _modelMetadataProvider, validationState, factory, customizations); // } // else { visitor = new ValidationVisitor( actionContext, validatorProvider, _validatorCache, _modelMetadataProvider, validationState); // } visitor.Validate(metadata, prefix, model); }