title: Comparing list to determine correct position within List<>
body: <p>I have two lists that I need to compare:</p>
  
  <pre><code>var list = new Guess(guesses, 0 , 0);// see class for constructor
  </code></pre>
  
  <p>and</p>
  
  <pre><code>theGame.Target = guesses;
  var list2 = theGame.Target;
  </code></pre>
  
  <p>I need to do the following:</p>
  
  <p><code>GuessTheDigits</code> Sets The Number Of <code>RightDigitsInTheRightPosition</code> Correctly</p>
  
  <p><strong>GuessTheDigits:</strong></p>
  
  <pre><code>public ActionResult GuessTheDigits(List&lt;int&gt; guesses)
  {
      GuessingGame theGame = this.Session["GameState"] as GuessingGame;
  
      // pass to the method
      theGame.GuessTheHiddenDigits(guesses);
  
      //set the lists
      var list = new Guess();
  
      theGame.Target = guesses;
  
      var list2 = theGame.Target;
  
      //need to compare lists here
  
      // Redirect to action
      return RedirectToAction("Index", theGame.Guesses);
  }
  </code></pre>
  
  <p><strong>Classes as follows:</strong></p>
  
  <p><strong>Guess Class</strong></p>
  
  <pre><code>public class Guess
  {
      public Guess()
          : this(new List&lt;int&gt;() { 1, 2, 3 }, 0, 0 )
      {
  
      }
      public Guess(List&lt;int&gt; guesses, int rdrp, int rdwp)
      {
          this.Digits = guesses;
          this.RightDigitRightPosition = rdrp;
          this.RightDigitWrongPosition = rdwp;
      }
  
      public Guess(List&lt;int&gt; guesses, int rdrp)
          : this(guesses, rdrp, 0)
      {
  
      }
  
      public Guess(List&lt;int&gt; guesses)
         : this(guesses, 0, 0)
      {
  
      }
  
      public List&lt;int&gt; Digits { get; set; }
      public int RightDigitRightPosition { get; set; }
      public int RightDigitWrongPosition { get; set; }
  }
  </code></pre>
  
  <p><strong>Previously tried code:</strong></p>
  
  <pre><code>var check = list2.Where(s =&gt; !theGame.Guesses.Contains(list));
  foreach (var i in check)
  {
      list.RightDigitRightPosition = i;
  }
  </code></pre>