public class ShoppingCartDomainRepository | |
{ | |
private readonly SalesDbContext _dbContext; | |
public ShoppingCartDomainRepository(SalesDbContext dbContext) | |
{ | |
_dbContext = dbContext; | |
} | |
public async Task<ShoppingCartDomain> GetShoppingCart(Guid shoppingCartId) | |
{ | |
var data = await _dbContext.ShoppingCarts | |
.Include(x => x.Items) | |
.SingleAsync(x => x.ShoppingCartId == shoppingCartId); | |
return new ShoppingCartDomain(data); | |
} | |
public async Task Save() | |
{ | |
await _dbContext.SaveChangesAsync(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment