Add player settings feature and settings API
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user