I'm working with SqlMetal (linq to sql) in order to retrieve stuff from the database. However, im getting different results using the following code:
var record1 = Enumerable.FirstOrDefault(_dataContext.StaticPageLangs,
r => r.selected_partial_url_id == partialUrlid
&& r.selected_last_part_url_id == lastPartUrlId
&& r.language_id == languageId);
var record2 = _dataContext.StaticPageLangs.FirstOrDefault(
r => r.selected_partial_url_id == partialUrlid
&& r.selected_last_part_url_id == lastPartUrlId
&& r.language_id == languageId);
After this record1 is filled, but record2 is NULL where i expect them to be the same.
Could anyone explain the difference?
Edit:
On a sidenote:
r.selected_partial_url_id is a nullable int and so is the property being compared r.selected_last_part_url_id is of the type int and so is the property being compared r.language_id is of the type int and so is the property being compared