Skip to content

Instantly share code, notes, and snippets.

@evgomes
Created January 30, 2019 16:14
Show Gist options
  • Save evgomes/59036a427482075dab3edb503b3fb0e3 to your computer and use it in GitHub Desktop.
Save evgomes/59036a427482075dab3edb503b3fb0e3 to your computer and use it in GitHub Desktop.
UnitOfWork implementation of Supermarket API
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