Whats the difference between these two query?
I am getting 0 from codes1.Count() but 1 from codes2.Count() but it should be 0 for both.
IQueryable<SecurityCode> codes1 = (from user in dataBase.SecurityUsers
from code in user.SecurityCodes
where user.UsrUserName.Equals(code.UsrUserName)
&& user.UsrPhone.Equals(phone)
select code);
IQueryable<SecurityCode> codes2 = (from user in dataBase.SecurityUsers
where user.UsrPhone.Equals(phone)
select user.SecurityCodes.FirstOrDefault());
The relationship is displayed below
Any explanation will be highly appreciated.