title: MVC, Only show first item for each different Name in foreach loop
body: <p>I have a list containing 6 items (rows). First column gives the property "Name" in each row:</p>
  
  <hr>
  
  <p><strong>Name</strong></p>
  
  <p>item1</p>
  
  <p>item1</p>
  
  <p>item1</p>
  
  <p>item2</p>
  
  <p>item2</p>
  
  <p>item2</p>
  
  <hr>
  
  <p>Is it possible to use a foreach loop to only show the first item of each different name so I get something like this:</p>
  
  <hr>
  
  <p>item1</p>
  
  <p>item2</p>
  
  <hr>
  
  <p>I have tried using Model.Take(1) but this only shows the first item in the entire list.</p>
  
  <p>My current loop looks like this:</p>
  
  <pre><code>foreach (var item in Model)
      {
          &lt;p&gt;@Html.DisplayFor(modelItem =&gt; item.Name)&lt;/p&gt;
      }
  </code></pre>