Пример #1
0
        public async Task <Guid> AddAsync(User user, CancellationToken cancellationToken = default)
        {
            await toolShedContext
            .AddAsync(user);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(user.UserId);
        }
Пример #2
0
        public async Task AddAsync(OrderRecord orderRecord, CancellationToken cancellationToken = default)
        {
            if (orderRecord == null)
            {
                throw new ArgumentNullException(nameof(orderRecord));
            }

            await toolShedContext.AddAsync(orderRecord, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Пример #3
0
        public async Task <Guid> AddAsync(ItemType itemType, CancellationToken cancellationToken = default)
        {
            if (itemType == null)
            {
                throw new ArgumentNullException();
            }

            await toolShedContext.AddAsync(itemType);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(itemType.ItemTypeId);
        }