public async Task <ActionResult <DiscountSchemeVM> > GetDiscountSchemeWithBid(int bidId) { DiscountScheme discountScheme = await discountSchemeService.GetDiscountSchemeWithBids(bidId); DiscountSchemeVM discountSchemeVM = new DiscountSchemeVM(discountScheme); discountSchemeVM.SetAddressBidCountDict(discountScheme); return(discountSchemeVM); }
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); }