Skip to content

Commit 839cf89

Browse files
committed
Update MusicStore and Identity to remove workarounds
Fixes #10714 Fixes #10668
1 parent f56c4c1 commit 839cf89

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Identity/EntityFrameworkCore/src/UserOnlyStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ public async override Task<TUser> FindByLoginAsync(string loginProvider, string
503503
{
504504
cancellationToken.ThrowIfCancellationRequested();
505505
ThrowIfDisposed();
506-
// TODO: Fix once EF query works Issue #10668
507-
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).ToList().SingleOrDefault());
506+
507+
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).SingleOrDefault());
508508
}
509509

510510
/// <summary>

src/Identity/EntityFrameworkCore/src/UserStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ public async override Task<TUser> FindByLoginAsync(string loginProvider, string
636636
{
637637
cancellationToken.ThrowIfCancellationRequested();
638638
ThrowIfDisposed();
639-
// TODO: Fix once EF query works Issue #10668
640-
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).ToList().SingleOrDefault());
639+
640+
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).SingleOrDefault());
641641
}
642642

643643
/// <summary>

src/MusicStore/samples/MusicStore/Controllers/StoreController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public async Task<IActionResult> Browse(string genre)
3636
{
3737
// Retrieve Genre genre and its Associated associated Albums albums from database
3838
var genreModel = await DbContext.Genres
39+
.Include(g => g.Albums)
3940
.Where(g => g.Name == genre)
4041
.FirstOrDefaultAsync();
4142

@@ -44,8 +45,6 @@ public async Task<IActionResult> Browse(string genre)
4445
return NotFound();
4546
}
4647

47-
await DbContext.Entry(genreModel).Collection(g => g.Albums).LoadAsync();
48-
4948
return View(genreModel);
5049
}
5150

src/MusicStore/samples/MusicStore/Models/ShoppingCart.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public async Task<decimal> GetTotal()
121121
// the current price for each of those albums in the cart
122122
// sum all album price totals to get the cart total
123123

124+
// No way to do decimal sum on server with SQLite, but client eval is fine here
124125
return (await _dbContext
125126
.CartItems
126127
.Where(c => c.CartId == _shoppingCartId)

0 commit comments

Comments
 (0)