using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using AsbCloudApp.Data; using AsbCloudApp.Repositories; using AsbCloudDb.Model; using Mapster; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Caching.Memory; namespace AsbCloudInfrastructure.Repository; public class FileCategoryRepository : CrudCacheRepositoryBase, IFileCategoryRepository { public FileCategoryRepository(IAsbCloudDbContext dbContext, IMemoryCache memoryCache) : base(dbContext, memoryCache) { } public FileCategoryRepository(IAsbCloudDbContext dbContext, IMemoryCache memoryCache, Func, IQueryable> makeQuery) : base(dbContext, memoryCache, makeQuery) { } public async Task> GetAllAsync(int idType, CancellationToken cancellationToken) { return await dbContext.FileCategories.Where(f => f.IdType == idType) .Select(f => f.Adapt()) .ToArrayAsync(cancellationToken); } }