Add player settings feature and settings API

This commit is contained in:
Holden
2026-06-20 22:58:33 -05:00
parent f4887c3f93
commit e77e479493
17 changed files with 405 additions and 3 deletions
@@ -12,6 +12,13 @@ public class ProfileRepository(DatabaseContext dbContext) : IProfileRepository
=> dbContext.Profiles
.FirstOrDefaultAsync(x => x.ProfileId == profileId, ct);
public Task<Profile?> GetByIdWithSettingsAsync(
Guid profileId,
CancellationToken ct = default)
=> dbContext.Profiles
.Include(x => x.Settings)
.FirstOrDefaultAsync(x => x.ProfileId == profileId, ct);
public Task<Avatar?> GetAvatarByProfileIdAsync(
Guid profileId,
CancellationToken ct = default)
@@ -21,6 +28,14 @@ public class ProfileRepository(DatabaseContext dbContext) : IProfileRepository
.Select(x => x.Avatar)
.FirstOrDefaultAsync(ct);
public async Task<IReadOnlyList<PlayerSetting>> GetSettingsByProfileIdAsync(
Guid profileId,
CancellationToken ct = default)
=> await dbContext.PlayerSettings
.AsNoTracking()
.Where(x => x.UserId == profileId)
.ToListAsync(ct);
public async Task<IReadOnlyList<Profile>> GetByIdsAsync(
List<Guid> profileIds,
CancellationToken ct = default)