public override ValidationResult Validate(IFormFileCollection formFileCollection)
        {
            var formFile = formFileCollection.Single();

            return(ValidateHeaders(formFile)
                ? base.Validate(formFileCollection)
                : ValidationResultFactory.CreateValidationResultError(ErrorMessages.ErrorCsvHeader));
        }
 public override ValidationResult Validate(IFormFileCollection formFileCollection)
 {
     return(formFileCollection.Single().ContentType != "text/csv"
         ? ValidationResultFactory.CreateValidationResultError(ErrorMessages.ContentTypeInvalid)
         : base.Validate(formFileCollection));
 }
 public override ValidationResult Validate(IFormFileCollection formFileCollection)
 {
     return(formFileCollection.Count == 0
         ? ValidationResultFactory.CreateValidationResultError(ErrorMessages.CsvFileIsMandatory)
         : base.Validate(formFileCollection));
 }
Пример #4
0
 public override ValidationResult Validate(IFormFileCollection formFileCollection)
 {
     return(formFileCollection.Count > 1
         ? ValidationResultFactory.CreateValidationResultError(ErrorMessages.OnlyOneFile)
         : base.Validate(formFileCollection));
 }