title: C# How to Access a Specific Index of a List of classes
body: <p>I have created a class called <code>studentRecord</code>, and it contains several properties such as <code>Student Number, First Name, Last Name, Courses, and Credit Hours</code> for keeping track of individual student records. I also have created a <code>list</code> called <code>List&lt;studentRecord&gt; lstRecords = new List&lt;studentRecord&gt;();</code> that stores the various objects (students). </p>
  
  <p>I understand adding a <code>student</code> object through using <code>lstRecords.Add();</code>, but am running in to trouble with editing the objects. The user is supposed to be able to enter a student number, and then be able to access and edit the properties of that specific instance of the object. I have come up with this code:</p>
  
  <pre><code>StudentRecord editRecord = lstRecords.Find(indexRecord =&gt; 
                      indexRecord.intStudentNumber == intChosenRecord);
  </code></pre>
  
  <p>(By the way, <code>intChosenRecord</code> is a variable I declared to keep track of which index they are looking for)</p>
  
  <p>I understand that <code>StudentRecord</code> is declaring a new object of that type, and that <code>editRecord</code> is my new object's name. However, I run into problems with using the <code>.Find()</code> method. I realize that <code>.Find()</code> searches through the list to find <em>something</em> that matches up with in input. Therefore, I assume that the <code>intChosenRecord</code> is what the program is searching for.</p>
  
  <p>However, I have no idea what <code>indexRecord</code> is! This is the only time that it is used within the code, and I can change it to any name I want without errors. Could someone explain what this code does, and what <code>indexRecord</code> is?</p>