31 lines
973 B
C#
31 lines
973 B
C#
using Portfolio.Application.Services.PokemonService;
|
|
using Portfolio.Domain.Features.Pokemon;
|
|
|
|
namespace Portfolio.WebUI.Server.Components.Pages.Pokemon_Pages
|
|
{
|
|
public partial class PokemonSleep
|
|
{
|
|
public List<Pokemon> pokemons = new List<Pokemon>();
|
|
public List<string> pokemonImageUrls = new List<string>();
|
|
public List<string> pokemonShinyImageUrls = new List<string>();
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
var result = await PokemonService.GetAllPokemonAsync();
|
|
if (result is not null)
|
|
{
|
|
pokemons = result;
|
|
pokemons.Sort((x, y) => x.PokemonId.CompareTo(y.PokemonId));
|
|
|
|
foreach (var pokemon in pokemons)
|
|
{
|
|
pokemonImageUrls.Add(pokemon.PokemonImageUrl);
|
|
pokemonShinyImageUrls.Add(pokemon.PokemonShinyImageUrl);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|