title: Simple stupid foreach loop question
body: <p>In the code below i`m trying to read a list of selected projects and a list of all projects available. </p>
  
  <p>I want to store the all the projects that have not been selected from the list of all projects. But with the code below, I`m having list of all projects...Where and how to break the second loop incase  projectId.Value == selectedProjectId.Value  ?</p>
  
  <p>public IEnumerable NotselectedProjects;
          public IEnumerable NotSelectedProjects()
          {</p>
  
  <pre><code>        if (this.NotselectedProjects == null)
          {
              List&lt;SelectListItem&gt; result = new List&lt;SelectListItem&gt;();
              foreach (var selectedProjectId in selectedProjects) 
              {
                  foreach (var projectId in projectLists)
                  {
                      if (projectId.Value != selectedProjectId.Value)
                      {
                          result.Add(new SelectListItem
                          {
                              Selected = false,
                              Text = projectId.Text,
                              Value = projectId.Value
                          });
                          this.NotselectedProjects = result.AsEnumerable();
                      }
                  }
              }
          }
          return this.NotselectedProjects;
  
      }
  </code></pre>