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);