Use Add instead of AddAsync
This commit is contained in:
parent
7da71fc5ee
commit
5b55da271c
|
|
@ -99,7 +99,7 @@ namespace MusicStore.Apis
|
|||
|
||||
// Save the changes to the DB
|
||||
var dbAlbum = new Album();
|
||||
await _storeContext.Albums.AddAsync(SimpleMapper.Map(album, dbAlbum));
|
||||
_storeContext.Albums.Add(SimpleMapper.Map(album, dbAlbum));
|
||||
await _storeContext.SaveChangesAsync();
|
||||
|
||||
// TODO: Handle missing record, key violations, concurrency issues, etc.
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace MusicStore.Areas.Admin.Controllers
|
|||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
await _dbContext.Albums.AddAsync(album, Context.RequestAborted);
|
||||
_dbContext.Albums.Add(album);
|
||||
await _dbContext.SaveChangesAsync(Context.RequestAborted);
|
||||
|
||||
var albumData = new AlbumData
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace MusicStore.Controllers
|
|||
order.OrderDate = DateTime.Now;
|
||||
|
||||
//Add the Order
|
||||
await _dbContext.Orders.AddAsync(order, Context.RequestAborted);
|
||||
_dbContext.Orders.Add(order);
|
||||
|
||||
//Process the order
|
||||
var cart = ShoppingCart.GetCart(_dbContext, Context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue