Update MusicStore and Identity to remove workarounds
Fixes #10714 Fixes #10668
This commit is contained in:
parent
f56c4c1c33
commit
839cf89252
|
|
@ -503,8 +503,8 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
ThrowIfDisposed();
|
ThrowIfDisposed();
|
||||||
// TODO: Fix once EF query works Issue #10668
|
|
||||||
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).ToList().SingleOrDefault());
|
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).SingleOrDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -636,8 +636,8 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
ThrowIfDisposed();
|
ThrowIfDisposed();
|
||||||
// TODO: Fix once EF query works Issue #10668
|
|
||||||
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).ToList().SingleOrDefault());
|
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).SingleOrDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ namespace MusicStore.Controllers
|
||||||
{
|
{
|
||||||
// Retrieve Genre genre and its Associated associated Albums albums from database
|
// Retrieve Genre genre and its Associated associated Albums albums from database
|
||||||
var genreModel = await DbContext.Genres
|
var genreModel = await DbContext.Genres
|
||||||
|
.Include(g => g.Albums)
|
||||||
.Where(g => g.Name == genre)
|
.Where(g => g.Name == genre)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
@ -44,8 +45,6 @@ namespace MusicStore.Controllers
|
||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
await DbContext.Entry(genreModel).Collection(g => g.Albums).LoadAsync();
|
|
||||||
|
|
||||||
return View(genreModel);
|
return View(genreModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ namespace MusicStore.Models
|
||||||
// the current price for each of those albums in the cart
|
// the current price for each of those albums in the cart
|
||||||
// sum all album price totals to get the cart total
|
// sum all album price totals to get the cart total
|
||||||
|
|
||||||
|
// No way to do decimal sum on server with SQLite, but client eval is fine here
|
||||||
return (await _dbContext
|
return (await _dbContext
|
||||||
.CartItems
|
.CartItems
|
||||||
.Where(c => c.CartId == _shoppingCartId)
|
.Where(c => c.CartId == _shoppingCartId)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue