We want to use swagger with in our asp.net core mvc web application. Because we use IoC to inject required instances in our controller, swagger is not able to build the swagger UI. When I remove the constructor it works fine.
Does anybody have an idea or an workaround using swagger with a constructor inside the controller?
[Route("TestNamesapce/TestService/2017/08/[controller]")]
public class TestController: FullController
{
private readonly IMaintenanceTaskProvider _provider;
private readonly MaintenanceServiceConfiguration _config;
private ILog _log;
private MessageWorker _worker;
/// <summary>
///
/// </summary>
/// <param name="log">The log.</param>
/// <param name="eventing">The eventing.</param>
/// <param name="worker">The worker.</param>
/// <param name="options">The options.</param>
/// <param name="context">The context.</param>
public TestController(ILog log, IEventingClient eventing, IFileManagementClient fileManagement, MessageWorker worker, IMaintenanceTaskProvider provider, IOptions<Configuration> options) : base(log, eventing, fileManagement)
{
_config = options.Value;
_log = log;
_provider = provider;
_worker = worker;
}
/// <summary>
/// Gets the internal license identifier.
/// </summary>
/// <returns></returns>
[HttpGet("GetInternalLicenseId")]
public string GetInternalLicenseId()
{
return "abcdefghijklmnop";
}