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

32 lines
985 B
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;
2024-08-19 10:01:07 +05:00
namespace AsbCloudInfrastructure.Services;
public class FileCategoryService : CrudCacheRepositoryBase<FileCategoryDto, FileCategory>, IFileCategoryService
{
2024-08-19 10:01:07 +05:00
public FileCategoryService(IAsbCloudDbContext context, IMemoryCache memoryCache)
: base(context, memoryCache) { }
2024-08-19 10:01:07 +05:00
//TODO: Перенести в сервис "дело скважины"
public async Task<IEnumerable<FileCategoryDto>> GetWellCaseCategoriesAsync(CancellationToken token)
{
2024-08-19 10:01:07 +05:00
var cache = await GetCacheAsync(token)
.ConfigureAwait(false);
var dtos = cache
.Where(f => f.Id >= 10000)
.Where(f => f.Id <= 20000)
.Select(Convert);
2022-11-16 17:07:47 +05:00
2024-08-19 10:01:07 +05:00
return dtos;
}
}