feat(api): Application GetAll, Work GetAll - добавлены фильтры по id
This commit is contained in:
@@ -14,5 +14,11 @@ namespace PARR.API.Contracts.V1.Requests.Queries
|
|||||||
/// Поиск по типу
|
/// Поиск по типу
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? TypeId { get; set; }
|
public Guid? TypeId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск по ИД
|
||||||
|
/// </summary>
|
||||||
|
public Guid? Id { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,5 +11,10 @@
|
|||||||
/// Поиск по имени. Например: "прочее"
|
/// Поиск по имени. Например: "прочее"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск по ИД
|
||||||
|
/// </summary>
|
||||||
|
public Guid? Id { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ namespace PARR.API.Controllers.V1
|
|||||||
if (filter.TypeId.HasValue)
|
if (filter.TypeId.HasValue)
|
||||||
query = query.Where(t => t.ApplicationTypeId == filter.TypeId);
|
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();
|
var apps = await applicationService.GetPage(query, paginationFilter).ToListAsync();
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ namespace PARR.API.Controllers.V1
|
|||||||
if (!string.IsNullOrWhiteSpace(filter.Name))
|
if (!string.IsNullOrWhiteSpace(filter.Name))
|
||||||
query = query.Where(t => t.Name.ToLower().Contains(filter.Name.ToLower()));
|
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();
|
var works = await workService.GetPage(query, paginationFilter).ToListAsync();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user