From 14519a843d33e88344a2bb5d9c33461b67d6f717 Mon Sep 17 00:00:00 2001 From: Mikhail Kuznetsov Date: Thu, 11 Sep 2025 16:45:33 +1000 Subject: [PATCH] =?UTF-8?q?feat(api):=20TnkController=20=D0=B2=20GetAll=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=20=D0=BF=D0=BE=20=D0=B8=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=20=D0=A2=D0=9D=D0=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API/Contracts/V1/Requests/Queries/TnkQuery.cs | 5 +++++ PARR.API/Controllers/V1/TnkController.cs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/PARR.API/Contracts/V1/Requests/Queries/TnkQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/TnkQuery.cs index d799d9ec..8aa765e1 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/TnkQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/TnkQuery.cs @@ -2,6 +2,11 @@ { public class TnkQuery { + /// + /// Поиск по имени + /// + public string? Name { get; set; } + /// /// Фильтр по ИД подпроцесса /// diff --git a/PARR.API/Controllers/V1/TnkController.cs b/PARR.API/Controllers/V1/TnkController.cs index 17248fc9..b1a911a0 100644 --- a/PARR.API/Controllers/V1/TnkController.cs +++ b/PARR.API/Controllers/V1/TnkController.cs @@ -59,6 +59,9 @@ namespace PARR.API.Controllers.V1 IQueryable query = tnkService.Get() .OrderBy(t => t.Name); + if (!string.IsNullOrEmpty(filter.Name)) + query = query.Where(t => t.Name.ToLower().Contains(filter.Name.ToLower())); + if (filter.SubprocessId.HasValue) query = query.Where(t => t.SubprocessId == filter.SubprocessId);