asked on
What is wrong with this linq statement?
private List<OnBoard> onboards = new List<OnBoard>();
public OnBoard obr;
public Member member;
onboards = (List<OnBoard>)db.OnBoards.ToList();
var result = from obr in onboards where obr.MemberId == member.MemberId select obr;
This compiles and executes with no errors, but obr is null after execution when onboards contains 500+ records and one does matches the requirements of the test (where obr.memberID == member.MemberID). Right now there is only one record which matches.