diff --git a/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs index fa3d2a61..2068773b 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/ApplicationQuery.cs @@ -14,5 +14,11 @@ namespace PARR.API.Contracts.V1.Requests.Queries /// Поиск по типу /// public Guid? TypeId { get; set; } + + + /// + /// Поиск по ИД + /// + public Guid? Id { get; set; } } } diff --git a/PARR.API/Contracts/V1/Requests/Queries/WorkGetAllQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/WorkGetAllQuery.cs index e6c82d2d..53135642 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/WorkGetAllQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/WorkGetAllQuery.cs @@ -11,5 +11,10 @@ /// Поиск по имени. Например: "прочее" /// public string? Name { get; set; } + + /// + /// Поиск по ИД + /// + public Guid? Id { get; set; } } } diff --git a/PARR.API/Controllers/V1/ApplicationController.cs b/PARR.API/Controllers/V1/ApplicationController.cs index 49ce3fa4..7838cced 100644 --- a/PARR.API/Controllers/V1/ApplicationController.cs +++ b/PARR.API/Controllers/V1/ApplicationController.cs @@ -55,6 +55,9 @@ namespace PARR.API.Controllers.V1 if (filter.TypeId.HasValue) query = query.Where(t => t.ApplicationTypeId == filter.TypeId); + if (filter.Id.HasValue) + query = query.Where(t => t.Id == filter.Id); + var apps = await applicationService.GetPage(query, paginationFilter).ToListAsync(); diff --git a/PARR.API/Controllers/V1/WorkController.cs b/PARR.API/Controllers/V1/WorkController.cs index c00e9fee..5d781b9b 100644 --- a/PARR.API/Controllers/V1/WorkController.cs +++ b/PARR.API/Controllers/V1/WorkController.cs @@ -65,6 +65,9 @@ namespace PARR.API.Controllers.V1 if (!string.IsNullOrWhiteSpace(filter.Name)) query = query.Where(t => t.Name.ToLower().Contains(filter.Name.ToLower())); + if (filter.Id.HasValue) + query = query.Where(t => t.Id == filter.Id); + var works = await workService.GetPage(query, paginationFilter).ToListAsync();