title: AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping. Swagger Consuming another API - .net 6
body: <p>I am trying to consume a web service in my web api application and got the the error on the title while testing.  I checked my mapping and it looks ok.  I am trying to follow the Repository pattern. Below is my code:</p>
  <p>The model:</p>
  <pre><code> using System;
  using System.ComponentModel.DataAnnotations;
  
  namespace AppleApi.Models
  {
      public class ApplicantInfo
      {
          [Key]
          public int Ctr { get; set; }
  
          public int Case_ID { get; set; }
  
          public int Actor_ID { get; set; }
  
          public string Name1 { get; set; }
  
          public string Name3 { get; set; }
  
          public string Full_Name { get; set; }
  
          public string Full_Name_Original { get; set; }
  
          public string Address { get; set; }
  
          public string Zip_Code { get; set; }
  
          public string State_ID { get; set; }
  
          public string Address { get; set; }
  
          public string Code { get; set; }
  
          public string State_ID { get; set; }
  
          public string Match { get; set; }
  
          public bool PartyChangedIndicator { get; set; }
  
      }
  }
  </code></pre>
  <p>The code on the DTO</p>
  <pre><code>using System;
  namespace AppleApi.Dto
  {
      public class ApplicantInfoDto
      {
  
          public int Ctr { get; set; }
  
          public int Case_ID { get; set; }
  
          public int Actor_ID { get; set; }
  
          public string Name1 { get; set; }
  
          public string Name3 { get; set; }
  
          public string Full_Name { get; set; }
  
          public string Full_Name_Original { get; set; }
  
          public string Address { get; set; }
  
          public string Zip_Code { get; set; }
  
          public string State_ID { get; set; }
  
          public string Address { get; set; }
  
          public string Zip_Code { get; set; }
  
          public string State_ID { get; set; }
  
          public string Match { get; set; }
      }
  }
  </code></pre>
  <p>The DB Context file:</p>
  <pre><code>        public DbSet&lt;ApplicantInfo&gt; ApplicantInfos { get; set; }
  </code></pre>
  <p>The Interface</p>
  <pre><code>using System;
  using AppleApi.Models;
  
  namespace AppleApi.Interfaces
  {
      public interface IApplicantInfoRepository
      {
          Task&lt;List&lt;ApplicantInfo&gt;&gt; GetAllAsync();
          Task&lt;ApplicantInfo&gt; GetApplicantInfoAsync(string Number);
          Task&lt;ApplicantInfo&gt; CreateApplicantInfoAsync(ApplicantInfo ApplicantInfo);      
          
      }
  }
  </code></pre>
  <p>and the Repository</p>
  <pre><code>    using System;
  using AppleApi.Interfaces;
  using AppleApi.Models;
  using AutoMapper;
  using Newtonsoft.Json;
  
  namespace AppleApi.Repository
  {
      public class ApplicantRepository : IApplicantInfoRepository
      {
  
          private IConfiguration _configuration;
          private IWebHostEnvironment _env;
          private readonly HttpClient _client;
  
  
          public WipoApplicantRepository(IConfiguration configuration, IWebHostEnvironment webHostEnvironment, HttpClient client)
          {
              this._configuration = configuration;
              this._env = webHostEnvironment;
              this._client = client;
          }
  
         
  
          
  
          public async Task&lt;ApplicantInfo&gt; GetApplicantInfoAsync(string Number)
          {
              string baseUrl = _configuration.GetSection(&quot;BaseAPI&quot;).GetSection(&quot;baseURL&quot;).Value;
  
              var httpResponse = await _client.GetAsync($&quot;{baseUrl}{Number}&quot;);
  
              if (!httpResponse.IsSuccessStatusCode)
              {
                  throw new Exception(&quot;Cannot retrieve tasks&quot;);
              }
  
              var content = await httpResponse.Content.ReadAsStringAsync();
              var ApplicantInfo = JsonConvert.DeserializeObject&lt;ApplicantInfo&gt;(content);
  
              return ApplicantInfo;
          }
      }
  }
  </code></pre>
  <p>and lastly the Controller</p>
  <pre><code>using System;
  using System.Web.Http.Cors;
  using AppleApi.Dto;
  using AppleApi.Interfaces;
  using AAppleApi.Models;
  using AutoMapper;
  using Microsoft.AspNetCore.Mvc;
  
  namespace AppleApi.Controllers
  {
  
      [Route(&quot;api/[controller]&quot;)]
      [ApiController]
      [EnableCors(origins: &quot;https://localhost:7059/&quot;, headers: &quot;*&quot;, methods: &quot;*&quot;)]
      public class ApplicantInfoController : Controller
      {
  
          private readonly IApplicantInfoRepository _ApplicantInfoRepository;
          private readonly IMapper _mapper;
  
          public ApplicantInfoController(IApplicantInfoRepository ApplicantInfoRepository, IMapper mapper)
          {
              this._ApplicantInfoRepository =  ApplicantInfoRepository;
              this._mapper = mapper;
          }
  
  
  
          [HttpGet(&quot;{Number}&quot;)]
          [ProducesResponseType(200, Type = typeof(ApplicantInfo))]
          [ProducesResponseType(400)]
          public IActionResult GetApplicantInfo(string Number)
          {
  
  
  
              
  
              var ApplicantInfo = _mapper.Map&lt;ApplicantInfoDto&gt;(_ApplicantInfoRepository.GetApplicantInfoAsync(Number));
  
              if (!ModelState.IsValid)
                  return BadRequest(ModelState);
  
              return Ok(ApplicantInfo);
          }
  
  
      }
  }
  </code></pre>
  <p>and the mapping profile codes is as shown below:</p>
  <pre><code>using System;
  using AppleApi.Dto;
  using AppleApi.Models;
  using AutoMapper;
  
  namespace AppleApi.Helper
  {
      public class MappingProfiles : Profile
      {
          public MappingProfiles()
          {
              
              CreateMap&lt;ApplicantInfo, ApplicantInfoDto&gt;();
              CreateMap&lt;ApplicantInfoDto, ApplicantInfo&gt;();
  
          }
  
      }
  }
  </code></pre>
  <p>This is my first .net application, I'll understand if I made some silly mistakes.</p>