using Microsoft.EntityFrameworkCore; using SVSim.Database.Models; namespace SVSim.Database.Repositories.Globals; public class GlobalsRepository : IGlobalsRepository { private readonly SVSimDbContext _dbContext; public GlobalsRepository(SVSimDbContext dbContext) { _dbContext = dbContext; } public async Task> GetClassExpCurve() { return await _dbContext.Set().ToListAsync(); } public async Task> GetBattlefields(bool onlyOpen) { return await _dbContext.Set().Where(bf => !onlyOpen || bf.IsOpen).ToListAsync(); } public async Task GetGameConfiguration(string key) { return await _dbContext.Set().Include(gc => gc.DefaultMyPageBackground) .Include(gc => gc.DefaultEmblem).Include(gc => gc.DefaultDegree).Include(gc => gc.DefaultSleeve).FirstOrDefaultAsync(gc => gc.Id == key) ?? new GameConfiguration(); } public async Task> GetRankInfo() { return await _dbContext.Set().ToListAsync(); } }