title: Error : CS0029 Cannot implicitly convert type 'System.Collections.Generic.List<int>' to 'X'?
body: <p>I'm trying to get data from a LocalDb into my MVC Controller. I'm using this code but doesn't work :</p>
  
  <pre><code> public StatusCategory BranchIdSearch(string branch){
       var categoryId = _context.StatusCategories
           .Where(a =&gt; a.StatusCategoryTitle.Contains(branch))
           .Select(a =&gt; a.StatusCategoryId)
           .ToList();
       return categoryId;
   }
  </code></pre>
  
  <p>Error :</p>
  
  <blockquote>
    <p>CS0029 Cannot implicitly convert type 'System.Collections.Generic.List' to 'ProjectName.Data.Models.StatusCategory</p>
  </blockquote>
  
  <p>StatusCategory.cs File :</p>
  
  <pre><code>public class StatusCategory
  {
      [Key]
      public int StatusCategoryId { get; set; }
      public string StatusCategoryTitle { get; set; }
      public virtual IEnumerable&lt;Status&gt; Status { get; set; }
  }
  </code></pre>
  
  <p><strong>LocalDb Table :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/nbuk8.png" rel="nofollow noreferrer">StatusCategory Table Structure</a></p>
  
  <p>Need help, Any idea why it's not working?</p>