@foreach (var claims in Model.Claims.ToList().Where(w => w.memberid == User.Identity.Name.Substring(User.Identity.Name.IndexOf('(') + 1, (User.Identity.Name.IndexOf(')') - 1) - User.Identity.Name.IndexOf('('))) ) { var uid = User.Identity.Name.Substring(User.Identity.Name.IndexOf('(') + 1, (User.Identity.Name.IndexOf(')') - 1) - User.Identity.Name.IndexOf('(')); var mid = claims.memberid; if (uid == mid) { <tr class="odd-row"> <td>N/A</td> <td>@claims.healthplanid</td> <td>@claims.claimnumber</td>Unfortunately I do not have a clue (having never used LINQ, which is what I think this code is using) but I've asked him how come the first line (with the ToList().Where) doesn't just pull out the correct set of records and he doesn't know.