Use Add instead of AddAsync

This commit is contained in:
ajcvickers 2015-01-30 14:31:17 -08:00
parent 7da71fc5ee
commit 5b55da271c
3 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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

View File

@ -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);