public async Task <IEnumerable <ItemServiceModel> > GetPlanetaryResources(PriceSelector priceSelector) { var items = await this.GetItemServiceModels(); var selectorFunction = this.GetSelectorFunction(priceSelector); items.ForEach(selectorFunction); return(items); }
protected async Task OnPriceSelectorChangeHandler(PriceSelector selector) { this.PriceSelector = selector; this.IsSelected = true; this.BestItems = null; if (selector is PriceSelector.UserProvided) { this.BestItems = null; this.Prices = new PricesModel(); } await this.ValidateUserInput(); }
private Action <ItemServiceModel> GetSelectorFunction(PriceSelector priceSelector) => priceSelector switch {
private static decimal GetPrice(ItemPrice item, PriceSelector selector) => selector switch {