Exemplo n.º 1
0
        public async Task <ActionResult <DiscountSchemeVM> > GetDiscountSchemeWithBid(int bidId)
        {
            DiscountScheme discountScheme = await discountSchemeService.GetDiscountSchemeWithBids(bidId);

            DiscountSchemeVM discountSchemeVM = new DiscountSchemeVM(discountScheme);

            discountSchemeVM.SetAddressBidCountDict(discountScheme);

            return(discountSchemeVM);
        }
Exemplo n.º 2
0
        public static IDictionary <string, int> SetAddressBidCountDict(this DiscountSchemeVM discountSchemeVM, DiscountScheme discountScheme)
        {
            if (discountSchemeVM.DiscountSchemeId != discountScheme.DiscountSchemeId)
            {
                throw new InvalidOperationException("DiscountScheme Ids do not match");
            }

            discountSchemeVM.AddressBidCountDict = _SetAddressBidCountDict(discountScheme);
            return(discountSchemeVM.AddressBidCountDict);
        }