Skip to content

Commit 0aa4865

Browse files
committed
Just use one GamePhotoSubjectsIncluded
1 parent 1943cf3 commit 0aa4865

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Refresh.Database/GameDatabaseContext.Photos.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ public partial class GameDatabaseContext // Photos
2020
.Include(p => p.Level)
2121
.Include(p => p.Level!.Publisher)
2222
.Include(p => p.Level!.Publisher!.Statistics);
23-
24-
private IQueryable<GamePhotoSubject> GamePhotoSubjectsIncludingUsers => this.GamePhotoSubjects
23+
24+
private IQueryable<GamePhotoSubject> GamePhotoSubjectsIncluded => this.GamePhotoSubjects
2525
.Include(p => p.User)
26-
.Include(p => p.User!.Statistics);
27-
28-
private IQueryable<GamePhotoSubject> GamePhotoSubjectsIncludingPhotos => this.GamePhotoSubjects
26+
.Include(p => p.User!.Statistics)
2927
.Include(p => p.Photo)
3028
.Include(p => p.Photo!.Publisher)
3129
.Include(p => p.Photo!.Publisher.Statistics)
@@ -221,7 +219,7 @@ public void RemovePhoto(GamePhoto photo)
221219
}
222220

223221
public IQueryable<GamePhotoSubject> GetSubjectsInPhoto(GamePhoto photo)
224-
=> this.GamePhotoSubjectsIncludingUsers.Where(s => s.PhotoId == photo.PhotoId);
222+
=> this.GamePhotoSubjectsIncluded.Where(s => s.PhotoId == photo.PhotoId);
225223

226224
public IQueryable<GameUser> GetUsersInPhoto(GamePhoto photo)
227225
=> this.GetSubjectsInPhoto(photo)
@@ -251,7 +249,7 @@ public int GetTotalPhotosByUser(GameUser user)
251249

252250
[Pure]
253251
public DatabaseList<GamePhoto> GetPhotosWithUser(GameUser user, int count, int skip) =>
254-
new(this.GamePhotoSubjectsIncludingPhotos
252+
new(this.GamePhotoSubjectsIncluded
255253
.Where(s => s.UserId == user.UserId)
256254
.Select(s => s.Photo), skip, count);
257255

0 commit comments

Comments
 (0)