using AutoMapper; using Azure; using Microsoft.EntityFrameworkCore; using Portfolio.Application.Services; using Portfolio.Domain.Features.Dtos; using Portfolio.Domain.Features.Pokemon; using Portfolio.Domain.Utility; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Portfolio.Infrastructure.Repositories { public class PokemonRepository : IPokemonRepository { private readonly ApplicationDbContext _context; private readonly IBaseService _baseService; private ResponseDto _response; private IMapper _mapper; public PokemonRepository(ApplicationDbContext context, IMapper mapper, IBaseService baseService) { _context = context; _baseService = baseService; _mapper = mapper; _response = new ResponseDto(); } public async Task GetAllPokemon() { return await _baseService.SendAsync(new RequestDto() { ApiType = StaticDetails.ApiType.GET, Url = StaticDetails.PokemonSleepAPIBase + "/api/pokemon" }); //try //{ // IEnumerable objList = _context.Pokemons.ToList(); // _response.IsSuccess = true; // _response.Message = "All Pokemon found."; // _response.Result = _mapper.Map>(objList); //} //catch (Exception ex) //{ // _response.IsSuccess = false; // _response.Message = ex.Message; //} //return _response; } } }