From 7b8506e44dfd5ded85545a10acf43348831fe363 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Thu, 23 Mar 2023 11:11:54 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81:=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20=D0=BA=D0=BB=D1=8E=D1=87=D0=B0?= =?UTF-8?q?=20=D1=81=D0=BA=D0=B2=D0=B0=D0=B6=D0=B8=D0=BD=D1=8B=20=D0=B2=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=D0=BB=D0=B5=D1=80=D0=B0,=20=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=B2=20=D1=81=D0=B2=D0=BE=D0=B9=D1=81=D1=82=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0=20(=D1=82.=D0=BA.=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=8D=D1=82=D0=BE=D0=BC=20=D0=BF=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=20=D1=84=D1=80=D0=BE=D0=BD=D1=82=D0=B5=D0=BD=D0=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/WellOperationDto.cs | 1 - AsbCloudWebApi/Controllers/WellOperationController.cs | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AsbCloudApp/Data/WellOperationDto.cs b/AsbCloudApp/Data/WellOperationDto.cs index 48ff9e30..9d8b631c 100644 --- a/AsbCloudApp/Data/WellOperationDto.cs +++ b/AsbCloudApp/Data/WellOperationDto.cs @@ -16,7 +16,6 @@ namespace AsbCloudApp.Data /// [Required] - [Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")] public int IdWell { get; set; } /// diff --git a/AsbCloudWebApi/Controllers/WellOperationController.cs b/AsbCloudWebApi/Controllers/WellOperationController.cs index a674b365..ba91097b 100644 --- a/AsbCloudWebApi/Controllers/WellOperationController.cs +++ b/AsbCloudWebApi/Controllers/WellOperationController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -199,8 +200,10 @@ namespace AsbCloudWebApi.Controllers [HttpPost] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task InsertRangeAsync(int idWell, [FromBody] IEnumerable values, - CancellationToken token) + public async Task InsertRangeAsync( + [Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")] int idWell, + [FromBody] IEnumerable values, + CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid();