Browse Source
Merge pull request #320 from MoienTajik/master
Made the AddAsync method fully asynchronous
main
Eric Fleming
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
11 deletions
-
src/Infrastructure/Data/EfRepository.cs
|
|
@ -1,6 +1,6 @@ |
|
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Entities; |
|
|
using Microsoft.eShopWeb.ApplicationCore.Entities; |
|
|
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
@ -43,7 +43,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data |
|
|
|
|
|
|
|
|
public async Task<T> AddAsync(T entity) |
|
|
public async Task<T> AddAsync(T entity) |
|
|
{ |
|
|
{ |
|
|
_dbContext.Set<T>().Add(entity); |
|
|
await _dbContext.Set<T>().AddAsync(entity); |
|
|
await _dbContext.SaveChangesAsync(); |
|
|
await _dbContext.SaveChangesAsync(); |
|
|
|
|
|
|
|
|
return entity; |
|
|
return entity; |
|
|
|