using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using AsbCloudApp.Data.Manuals; using AsbCloudApp.Repositories; using AsbCloudDb.Model; using AsbCloudDb.Model.Manuals; using Mapster; using Microsoft.EntityFrameworkCore; namespace AsbCloudInfrastructure.Repository; public class ManualRepository : CrudRepositoryBase, IManualRepository { public ManualRepository(IAsbCloudDbContext context) : base(context) { } public ManualRepository(IAsbCloudDbContext context, Func, IQueryable> makeQuery) : base(context, makeQuery) { } public async Task> GetManualsWithoutFolderAsync(int idCategory, CancellationToken cancellationToken) { return await dbContext.Manuals.Where(m => m.IdCategory == idCategory && m.IdFolder == null) .Select(m => m.Adapt()) .ToArrayAsync(cancellationToken); } }