DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/FileCategoryService.cs

34 lines
1.0 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudInfrastructure.Repository;
using Microsoft.Extensions.Caching.Memory;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services
{
public class FileCategoryService : CrudCacheRepositoryBase<FileCategoryDto, FileCategory>, IFileCategoryService
{
public FileCategoryService(IAsbCloudDbContext context, IMemoryCache memoryCache)
: base(context, memoryCache) { }
2022-11-16 17:07:47 +05:00
//TODO: Перенести в сервис "дело скважины"
2022-09-13 11:47:12 +05:00
public async Task<IEnumerable<FileCategoryDto>> GetWellCaseCategoriesAsync(CancellationToken token)
{
2022-09-13 11:47:12 +05:00
var cache = await GetCacheAsync(token)
.ConfigureAwait(false);
var dtos = cache
2022-11-16 17:07:47 +05:00
.Where(f => f.Id >= 10000)
.Where(f => f.Id <= 20000)
.Select(Convert);
2022-09-13 11:47:12 +05:00
return dtos;
}
}
}