示例#1
0
        public static Maybe <SuggestionsMade> TryMakeSuggestions(ShowId showId, PartyRequested partyRequested, AuditoriumSeating auditoriumSeating)
        {
            var suggestionsMade = new SuggestionsMade(showId, partyRequested);

            suggestionsMade.Add(GiveMeSuggestionsFor(auditoriumSeating, partyRequested, PricingCategory.First));
            suggestionsMade.Add(GiveMeSuggestionsFor(auditoriumSeating, partyRequested, PricingCategory.Second));
            suggestionsMade.Add(GiveMeSuggestionsFor(auditoriumSeating, partyRequested, PricingCategory.Third));
            suggestionsMade.Add(GiveMeSuggestionsFor(auditoriumSeating, partyRequested, PricingCategory.Mixed));

            if (suggestionsMade.MatchExpectations())
            {
                return(new Maybe <SuggestionsMade>(suggestionsMade));
            }

            return(new Maybe <SuggestionsMade>());
        }
示例#2
0
        public async Task <SuggestionsMade> MakeSuggestions(ShowId showId, PartyRequested partyRequested)
        {
            var auditoriumSeating = await _auditoriumSeatingAdapter.GetAuditoriumSeating(showId);

            var suggestionsMade = new SuggestionsMade(showId, partyRequested);

            suggestionsMade.Add(GiveMeSuggestionsFor(auditoriumSeating, partyRequested,
                                                     PricingCategoryRequested.First));
            suggestionsMade.Add(
                GiveMeSuggestionsFor(auditoriumSeating, partyRequested, PricingCategoryRequested.Second));
            suggestionsMade.Add(GiveMeSuggestionsFor(auditoriumSeating, partyRequested,
                                                     PricingCategoryRequested.Third));
            suggestionsMade.Add(GiveMeSuggestionsFor(auditoriumSeating, partyRequested,
                                                     PricingCategoryRequested.Mixed));

            if (suggestionsMade.DoesMatchExpectations())
            {
                return(suggestionsMade);
            }

            return(new SuggestionNotAvailable(showId, partyRequested));
        }