Created
January 30, 2019 16:14
-
-
Save evgomes/59036a427482075dab3edb503b3fb0e3 to your computer and use it in GitHub Desktop.
UnitOfWork implementation of Supermarket API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Tasks; | |
using Supermarket.API.Domain.Repositories; | |
using Supermarket.API.Persistence.Contexts; | |
namespace Supermarket.API.Persistence.Repositories | |
{ | |
public class UnitOfWork : IUnitOfWork | |
{ | |
private readonly AppDbContext _context; | |
public UnitOfWork(AppDbContext context) | |
{ | |
_context = context; | |
} | |
public async Task CompleteAsync() | |
{ | |
await _context.SaveChangesAsync(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment