title: Constructor is Ambiguous error .NET Core Web API
body: <p>I'm new to Web API. In my .NET Core 3.1 web api I have defined 3 constructors beleiving overloading.</p>
  
  <pre><code>[Route("api/[controller]")]
  [ApiController]
  public class KipController : ControllerBase
  {
      private readonly IConfiguration _configuration;
      private readonly IMapper _mapper;
      private readonly dbLNePMODev1Context _context;
      public KipController(IConfiguration configuration)
      {
          _configuration = configuration;
      }
      public KipController(IMapper mapper)
      {
          _mapper = mapper;
      }
  
      public KipController(dbLNePMODev1Context context)
      {
          _context = context;
      }
      ......
  </code></pre>
  
  <p>But when executing the application it says the following error</p>
  
  <blockquote>
    <p>System.AggregateException   HResult=0x80131500   Message=Some services
    are not able to be constructed (Error while validating the service
    descriptor 'ServiceType: epmoAPI.Models.dbLNePMODev1Context Lifetime:
    Scoped ImplementationType: epmoAPI.Models.dbLNePMODev1Context': Unable
    to activate type 'epmoAPI.Models.dbLNePMODev1Context'. The following
    constructors are ambiguous: Void
    .ctor(Microsoft.EntityFrameworkCore.DbContextOptions) Void
    .ctor(Microsoft.EntityFrameworkCore.DbContextOptions<code>1[epmoAPI.Models.dbLNePMODev1Context]))
    Source=Microsoft.Extensions.DependencyInjection   StackTrace:    at
    Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable</code>1
    serviceDescriptors, ServiceProviderOptions options)    at
    Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection
    services, ServiceProviderOptions options)    at
    Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory.CreateServiceProvider(IServiceCollection
    containerBuilder)    at
    Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object
    containerBuilder)    at
    Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()    at
    Microsoft.Extensions.Hosting.HostBuilder.Build()    at
    epmoAPI.Program.Main(String[] args) in C:\Projects\Enterprise
    PMO\ePMOHub\epmoAPI\Program.cs:line 16</p>
    
    <p>This exception was originally thrown at this call stack:
        [External Code]</p>
    
    <blockquote>
      <p>Inner Exception 1: InvalidOperationException: Error while validating
      the service descriptor 'ServiceType:
      epmoAPI.Models.dbLNePMODev1Context Lifetime: Scoped
      ImplementationType: epmoAPI.Models.dbLNePMODev1Context': Unable to
      activate type 'epmoAPI.Models.dbLNePMODev1Context'. The following
      constructors are ambiguous: Void
      .ctor(Microsoft.EntityFrameworkCore.DbContextOptions) Void
      .ctor(Microsoft.EntityFrameworkCore.DbContextOptions`1[epmoAPI.Models.dbLNePMODev1Context])</p>
      
      <p>Inner Exception 2: InvalidOperationException: Unable to activate type
      'epmoAPI.Models.dbLNePMODev1Context'. The following constructors are
      ambiguous: Void .ctor(Microsoft.EntityFrameworkCore.DbContextOptions)
      Void
      .ctor(Microsoft.EntityFrameworkCore.DbContextOptions`1[epmoAPI.Models.dbLNePMODev1Context])</p>
    </blockquote>
  </blockquote>
  
  <p>Please help me. I am not getting an idea whats wrong in my code</p>