Add avatar support
This commit is contained in:
@@ -12,6 +12,15 @@ public class ProfileRepository(DatabaseContext dbContext) : IProfileRepository
|
||||
=> dbContext.Profiles
|
||||
.FirstOrDefaultAsync(x => x.ProfileId == profileId, ct);
|
||||
|
||||
public Task<Avatar?> GetAvatarByProfileIdAsync(
|
||||
Guid profileId,
|
||||
CancellationToken ct = default)
|
||||
=> dbContext.Profiles
|
||||
.AsNoTracking()
|
||||
.Where(x => x.ProfileId == profileId)
|
||||
.Select(x => x.Avatar)
|
||||
.FirstOrDefaultAsync(ct);
|
||||
|
||||
public async Task<IReadOnlyList<Profile>> GetByIdsAsync(
|
||||
List<Guid> profileIds,
|
||||
CancellationToken ct = default)
|
||||
@@ -36,4 +45,4 @@ public class ProfileRepository(DatabaseContext dbContext) : IProfileRepository
|
||||
|
||||
public Task SaveChangesAsync(CancellationToken ct = default)
|
||||
=> dbContext.SaveChangesAsync(ct);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user