DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/FileCategoryService.cs
2022-11-16 17:07:47 +05:00

32 lines
951 B
C#

using AsbCloudApp.Data;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudInfrastructure.Repository;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services
{
public class FileCategoryService : CrudCacheServiceBase<FileCategoryDto, FileCategory>, IFileCategoryService
{
public FileCategoryService(IAsbCloudDbContext context)
: base(context)
{
}
//TODO: Перенести в сервис "дело скважины"
public async Task<IEnumerable<FileCategoryDto>> GetWellCaseCategoriesAsync(CancellationToken token)
{
var cache = await GetCacheAsync(token)
.ConfigureAwait(false);
var dtos = cache
.Where(f => f.Id >= 10000)
.Where(f => f.Id <= 20000);
return dtos;
}
}
}