title: Selecting a matching ID from a list of objects
body: <p>Okay so i have a list filled with objects which have the following properties:</p>
  
  <p><strong>category_id</strong> and <strong>category_title</strong></p>
  
  <p>In the code it looks like this:</p>
  
  <pre><code>class CategoryModel
  {
      public int category_id { get; private set; }
      public string category_title { get; private set; }
  
      //Constructor
      public CategoryModel(int id, string title)
      {
          category_id = id;
          category_title = title;
      }
  </code></pre>
  
  <p>I have multiple objects of this class stored in a list</p>
  
  <pre><code>    static List&lt;CategoryModel&gt; CategoryList = new List&lt;CategoryModel&gt;();
  </code></pre>
  
  <p>From this list i am trying to select the <strong>category_title</strong> where it matches a certain <strong>category_id</strong></p>
  
  <pre><code>    public static string GetCategoryName(int categoryNumber)
      {
          IEnumerable&lt;string&gt; title = from c in CategoryList
                      where c.category_id.Equals(categoryNumber)
                      select c.category_title;
          return title.ToString();
      }
  </code></pre>
  
  <p>So let's say GetCategoryName(4), it's now supposed to select from the list where <strong>category_id</strong> equals 4 and return <strong>category_title</strong></p>
  
  <p>However it seems that i'm not getting the name back but a syntax of the query instead! </p>
  
  <p>Output: <em>system.linq.enumerable.whereselectlistiterator'2[project.CategoryModel,System.string]</em></p>