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