public async Task AddAsync(UserCartItems userCartItems, CancellationToken cancellationToken = default) { await toolShedContext.UserCartItemsSet .AddAsync(userCartItems); await toolShedContext.SaveChangesAsync(cancellationToken); }
public async Task AddAsync(Guid userCartId, Guid itemId, CancellationToken cancellationToken = default) { var userCartItems = new UserCartItems { UserCartId = userCartId, ItemId = itemId }; await toolShedContext.UserCartItemsSet .AddAsync(userCartItems, cancellationToken); await toolShedContext.SaveChangesAsync(cancellationToken); }
public async Task AddAsync(Guid userCartId, IEnumerable <Guid> itemIds, CancellationToken cancellationToken = default) { foreach (var itemId in itemIds) { var userCartItems = new UserCartItems { UserCartId = userCartId, ItemId = itemId }; await toolShedContext.UserCartItemsSet .AddAsync(userCartItems, cancellationToken); await toolShedContext.SaveChangesAsync(cancellationToken); } }
public UserCartItemsRepositoryTests() { userCartItems = CreateUserCartItems(); userCartItemsRepository = GetInMemoryUserCartRepository(); }