public async Task <ServiceResponse <IGym> > GetGymAsync(Type textResource, string name, int interactiveLimit, Func <int, Task <ServiceResponse> > interactiveCallbackAction, FenceConfiguration[] fences = null) { return(await InteractiveServiceHelper.GenericGetEntityWithCallback( GetGymsByNameAsync(name, fences), list => list.Where(e => e.Name.ToLowerInvariant().Trim() == name.ToLowerInvariant().Trim()).ToList(), interactiveLimit, interactiveCallbackAction, gym => gym.Id, GetGymNameWithAdditionAsync, gym => gym.Name, () => LocalizationService.Get(textResource, "Gyms_Errors_NothingFound", name), list => LocalizationService.Get(textResource, "Gyms_Errors_ToManyFound", list.Count, name, interactiveLimit), list => LocalizationService.Get(textResource, "Gyms_Errors_InteractiveMode", list.Count, name) )); }
public async Task <ServiceResponse <RaidbossPokemon> > GetPokemonAndRaidbossAsync(Type textResource, string name, int interactiveLimit, Func <string, Task <ServiceResponse> > interactiveCallback) { return(await InteractiveServiceHelper.GenericGetEntityWithCallback( GetPossibleRaidbossPokemonAsync(name), list => list.Where(e => e.Pokemon.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)).ToList(), interactiveLimit, interactiveCallback, pokemon => pokemon.Pokemon.Name, (pokemon, list) => Task.FromResult(pokemon.Pokemon.Name), pokemon => pokemon.Pokemon.Name, () => LocalizationService.Get(textResource, "Pokemon_Errors_NothingFound", name, "raidboss-"), list => LocalizationService.Get(textResource, "Pokemon_Errors_ToManyFound", list.Count, name, interactiveLimit, "raidboss-"), list => LocalizationService.Get(textResource, "Pokemon_Errors_InteractiveMode", list.Count, name, "raidboss-") )); }