title: Cannot implicitly convert type 'Microsoft.AspNetCore.Mvc.BadRequestObjectResult'
body: <p>I have an asp.net core 2.1 project and I'm getting the following error in my controller action:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'Microsoft.AspNetCore.Mvc.BadRequestObjectResult' to
    'System.Collections.Generic.IList'. An explicit
    conversion exists (are you missing a cast?)</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>[HttpPost("create")]
  [ProducesResponseType(201, Type = typeof(Todo))]
  [ProducesResponseType(400)]
  public async Task&lt;IList&lt;Todo&gt;&gt; Create([FromBody]TodoCreateViewModel model)
  {
      if (!ModelState.IsValid)
      {
          return BadRequest(ModelState);   // This is the line that causes the intellisense error
      }
  
      await _todoRepository.AddTodo(model);
      return await GetActiveTodosForUser();
  }
  
  
  [HttpGet("GetActiveTodosForUser")]
  [ProducesResponseType(200)]
  [ProducesResponseType(404)]
  public async Task&lt;IList&lt;Todo&gt;&gt; GetActiveTodosForUser(string UserId = "")
  {
      if (string.IsNullOrEmpty(UserId))
      {
          UserId = HttpContext.User.FindFirstValue(ClaimTypes.Sid);
      }
      return await _todoRepository.GetAll(UserId, false);
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>