forked from ddrilling/AsbCloudServer
Фильтрация по категориям опреации: в ГГД выводятся только те, у которого isHidden = false
This commit is contained in:
parent
a91d95bc2e
commit
b5369c4363
@ -12,6 +12,6 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// список названий операций
|
/// список названий операций
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerable<WellOperationCategoryDto> Get(bool includeParents);
|
IEnumerable<WellOperationCategoryDto> Get(bool includeParents, bool includeHidden = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,11 +19,13 @@ public class WellOperationCategoryRepository : IWellOperationCategoryRepository
|
|||||||
this.memoryCache = memoryCache;
|
this.memoryCache = memoryCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<WellOperationCategoryDto> Get(bool includeParents)
|
public IEnumerable<WellOperationCategoryDto> Get(bool includeParents, bool includeHidden = true)
|
||||||
{
|
{
|
||||||
var categories = memoryCache
|
var categories = memoryCache
|
||||||
.GetOrCreateBasic(db.Set<WellOperationCategory>());
|
.GetOrCreateBasic(db.Set<WellOperationCategory>());
|
||||||
|
|
||||||
|
categories = categories.Where(o => includeHidden ? true : o.IsHidden == false);
|
||||||
|
|
||||||
if (!includeParents)
|
if (!includeParents)
|
||||||
{
|
{
|
||||||
var parentIds = categories
|
var parentIds = categories
|
||||||
|
Binary file not shown.
@ -172,7 +172,7 @@ public class WellOperationController : ControllerBase
|
|||||||
[ProducesResponseType(typeof(IEnumerable<WellOperationCategoryDto>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(IEnumerable<WellOperationCategoryDto>), StatusCodes.Status200OK)]
|
||||||
public IActionResult GetCategories(bool includeParents = true)
|
public IActionResult GetCategories(bool includeParents = true)
|
||||||
{
|
{
|
||||||
var result = wellOperationCategoryRepository.Get(includeParents);
|
var result = wellOperationCategoryRepository.Get(includeParents, false);
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user