using DCGEngine.Database.Models; using Microsoft.EntityFrameworkCore; using SVSim.Database.Models; namespace SVSim.Database.Repositories.Card; public class CardRepository : BaseRepository, ICardRepository { public CardRepository(SVSimDbContext dbContext) : base(dbContext) { } public async Task> GetAll(bool onlyCollectible) { var cards = await DbSet.AsNoTracking().Where(card => !onlyCollectible || card.CollectionInfo != null).ToListAsync(); return cards; } public async Task> GetAllBasic() { return await DbContext.Set().Where(set => set.IsBasic).SelectMany(set => set.Cards) .Cast().ToListAsync(); } public async Task> GetCardSets(bool onlyInRotation) { return await DbContext.Set().AsNoTracking() .Where(set => !onlyInRotation || set.IsInRotation).ToListAsync(); } }