I know we achieve multiple conditions in a join by using anonymous classes, but can anyone please confirm that below method won’t work? Doesn’t seem to and I am having tough time verifying.
...
join up in db.UserProfiles on
new { UserId = uf.UserId, IsDeleted = false, IsApproved = true } equals
new { UserId = up.UserId, IsDeleted = up.IsDeleted ?? false, IsApproved = up.aspnet_User.aspnet_Membership.IsApproved }
To answer my own question, ‘constant’ Attributes in anonymous classes in a linq to sql join is valid and does bring expected results. The root cause of unexpected behavior I noticed is a totally different issue – Described Here