Example #1
0
        /// <summary>
        /// add tenant
        /// </summary>
        /// <param name="tenant">tenant dto</param>
        public async Task AddAsync(Tenant tenant, CancellationToken cancellationToken = default)
        {
            await toolShedContext.TenantSet
            .AddAsync(tenant);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
        public async Task AddAsync(UserCartItemRentals userCartItemRentals, CancellationToken cancellationToken = default)
        {
            await toolShedContext.UserCartItemRentalsSet
            .AddAsync(userCartItemRentals, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #3
0
        public async Task AddAsync(MaintenanceProvider maintenanceProvider, CancellationToken cancellationToken = default)
        {
            await toolShedContext.MaintenanceProviderSet
            .AddAsync(maintenanceProvider, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #4
0
        public async Task AddAsync(UserAddresses userAddresses, CancellationToken cancellationToken = default)
        {
            await toolShedContext.UserAddressesSet
            .AddAsync(userAddresses);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #5
0
        public async Task AddAsync(UserCart userCart, CancellationToken cancellationToken = default)
        {
            await toolShedContext.UserCartSet
            .AddAsync(userCart);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #6
0
        public async Task <Guid> AddAsync(Card card, CancellationToken cancellationToken = default)
        {
            await toolShedContext.CardSet
            .AddAsync(card);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(card.CardId);
        }
Example #7
0
        public async Task <Guid> AddAsync(User user, CancellationToken cancellationToken = default)
        {
            await toolShedContext
            .AddAsync(user);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(user.UserId);
        }
Example #8
0
        public async Task <Guid> AddAsync(Item item, CancellationToken cancellationToken = default)
        {
            await toolShedContext.ItemSet
            .AddAsync(item);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(item.ItemId);
        }
Example #9
0
        public async Task <Guid> AddAsync(Dispenser dispenser, CancellationToken cancellationToken = default)
        {
            await toolShedContext.DispenserSet
            .AddAsync(dispenser);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(dispenser.DispenserId);
        }
        public async Task <IActionResult> Create([Bind("brand,toolbox,hasToolbox,ID,name,price,SKU,acqDate")] Tool tool)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tool);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tool));
        }
Example #11
0
        public async Task AddItemToDispenserAsync(Guid itemId, Guid dispenserId, CancellationToken cancellationToken = default)
        {
            var dispenserItem = new DispenserItem
            {
                ItemId      = itemId,
                DispenserId = dispenserId
            };
            await toolShedContext.DispenserItemSet
            .AddAsync(dispenserItem);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #12
0
        public async Task AddAsync(OrderDetail orderDetails, CancellationToken cancellationToken = default)
        {
            if (orderDetails == null)
            {
                throw new ArgumentNullException();
            }

            await toolShedContext.OrderDetailsSet
            .AddAsync(orderDetails);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #13
0
        public async Task AddAsync(CardAddress cardAddress, CancellationToken cancellationToken = default)
        {
            if (cardAddress == null)
            {
                throw new ArgumentNullException(nameof(cardAddress));
            }

            await toolShedContext.CardAddressSet
            .AddAsync(cardAddress, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
        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);
        }
Example #15
0
        public async Task AddAsync(Guid tenantId, Guid userId, CancellationToken cancellationToken = default)
        {
            var tenantUser = new TenantUser
            {
                TenantId = tenantId,
                UserId   = userId
            };

            await toolShedContext.TenantUserSet
            .AddAsync(tenantUser);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #16
0
        public async Task <Guid> AddAsync(Rental rental, CancellationToken cancellationToken = default)
        {
            if (rental == null)
            {
                throw new ArgumentNullException();
            }

            await toolShedContext.RentalSet
            .AddAsync(rental, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(rental.RentalId);
        }
Example #17
0
        public async Task <Guid> AddAsync(Address address, CancellationToken cancellationToken = default)
        {
            if (address == null)
            {
                throw new ArgumentNullException(nameof(address));
            }

            await toolShedContext.AddressSet
            .AddAsync(address, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(address.AddressId);
        }
Example #18
0
        public async Task <Guid> AddItemBundleMappingAsync(ItemBundleMapping itemBundleMapping, CancellationToken cancellationToken = default)
        {
            if (itemBundleMapping == null)
            {
                throw new ArgumentNullException();
            }

            await toolShedContext.ItemBundleMappingSet
            .AddAsync(itemBundleMapping);

            await toolShedContext.SaveChangesAsync(cancellationToken);

            return(itemBundleMapping.ItemBundleMappingId);
        }
        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);
        }
Example #20
0
        public async Task AddAsync(ItemRentalDetails itemRentalDetails, CancellationToken cancellationToken = default)
        {
            if (itemRentalDetails == null)
            {
                throw new ArgumentNullException();
            }

            await toolShedContext.ItemRentalDetailsSet
            .AddAsync(itemRentalDetails, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Example #21
0
        public async Task AddAsync(StateSalesTaxes stateSalesTaxes, CancellationToken cancellationToken = default)
        {
            if (stateSalesTaxes == null)
            {
                throw new ArgumentNullException();
            }

            await toolShedContext.StateSalesTaxesSet
            .AddAsync(stateSalesTaxes, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
        public async Task AddAsync(RentalRecord rentalRecord, CancellationToken cancellationToken = default)
        {
            if (rentalRecord == null)
            {
                throw new ArgumentNullException();
            }

            await toolShedContext.RentalRecordSet
            .AddAsync(rentalRecord, cancellationToken);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }