правки по валидации

This commit is contained in:
Olga Nemt 2024-01-25 16:52:27 +05:00
parent 672f78fca9
commit 4bd0a835fc
2 changed files with 5 additions and 6 deletions

View File

@ -292,7 +292,7 @@ namespace AsbCloudWebApi.Controllers
}
var validationResult = Validate(wellOperations, deleteBeforeInsert, cancellationToken);
var validationResult = await Validate(wellOperations, deleteBeforeInsert, cancellationToken);
if (validationResult.Any())
return this.ValidationBadRequest(validationResult);
@ -309,7 +309,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="deleteBeforeInsert"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
private IEnumerable<ValidationResult> Validate(IEnumerable<WellOperationDto> wellOperations, bool deleteBeforeInsert, CancellationToken cancellationToken)
private async Task<IEnumerable<ValidationResult>> Validate(IEnumerable<WellOperationDto> wellOperations, bool deleteBeforeInsert, CancellationToken cancellationToken)
{
if (deleteBeforeInsert)
return operationRepository.Validate(wellOperations);

View File

@ -65,8 +65,7 @@ namespace Microsoft.AspNetCore.Mvc
/// </para>
/// </summary>
/// <param name="controller"></param>
/// <param name="paramName"></param>
/// <param name="error"></param>
/// <param name="validationResults"></param>
/// <returns></returns>
public static BadRequestObjectResult ValidationBadRequest(this ControllerBase controller, IEnumerable<ValidationResult> validationResults)
{