title: remove duplicates from linq query c#
body: <p>This is my linq query and I get lots of duplicates with school names.
  so I created a regex function to trim the text:</p>
  
  <pre><code>public static string MyTrimmings(string str)
          {
          return Regex.Replace(str, @"^\s*$\n", string.Empty, RegexOptions.Multiline).TrimEnd();
          }
  </code></pre>
  
  <p>the text gets trimed alright, however, the dropdown values are all duplicates! please help me eliminate duplicates, oh Linq joy!!</p>
  
  <pre><code>ViewBag.schools = new[]{new SelectListItem
              {
                  Value = "",
                  Text = "All"
              }}.Concat(
              db.Schools.Where(x =&gt; (x.name != null)).OrderBy(o =&gt; o.name).ToList().Select(s =&gt; new SelectListItem
              {
                  Value = MyTrimmings(s.name),
                  Text = MyTrimmings(s.name)
              }).Distinct()
              );    
  </code></pre>