diff --git a/AsbCloudWebApi/Controllers/WellOperationController.cs b/AsbCloudWebApi/Controllers/WellOperationController.cs index 79c7d900..74d4e16f 100644 --- a/AsbCloudWebApi/Controllers/WellOperationController.cs +++ b/AsbCloudWebApi/Controllers/WellOperationController.cs @@ -237,8 +237,8 @@ namespace AsbCloudWebApi.Controllers wellOperation.IdUser = User.GetUserId(); wellOperation.IdType = idType; - var validationResult = awaitoperationRepository.ValidateWithDbAsync(new[] { wellOperation }, cancellationToken); - if(validationResult.Any()) + var validationResult = await operationRepository.ValidateWithDbAsync(new[] { wellOperation }, cancellationToken); + if (validationResult.Any()) return this.ValidationBadRequest(validationResult); var result = await operationRepository.InsertRangeAsync(new[] { wellOperation }, cancellationToken); @@ -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 /// /// /// - private IEnumerable Validate(IEnumerable wellOperations, bool deleteBeforeInsert, CancellationToken cancellationToken) + private async Task> Validate(IEnumerable wellOperations, bool deleteBeforeInsert, CancellationToken cancellationToken) { if (deleteBeforeInsert) return operationRepository.Validate(wellOperations); diff --git a/AsbCloudWebApi/Extentions.cs b/AsbCloudWebApi/Extentions.cs index c064d2de..5659292c 100644 --- a/AsbCloudWebApi/Extentions.cs +++ b/AsbCloudWebApi/Extentions.cs @@ -65,8 +65,7 @@ namespace Microsoft.AspNetCore.Mvc /// /// /// - /// - /// + /// /// public static BadRequestObjectResult ValidationBadRequest(this ControllerBase controller, IEnumerable validationResults) {