views:

54

answers:

2

this linq query

var users = from u in context.Users
            where u.UserEMailAdresses.Any(e1 => e1.EMailAddress == userEMail) && u.UserPasswords.Any(e2 => e2.PasswordSaltedHash == passwordSaltedHash)
            select u;
return users.Count();

returns: 1 even when there is nothing in password table.

how come?

what i am trying to do is get the values of email and passwordHash from two separate tables (UserEMailAddresses and UserPasswords) linked via foreign keys to the third table (Users).

it should be simple - checking if email and password mach from form to database. but it is not working for me.

i get 1 (for count) even when there are NO entries in the UserPasswords table.

is the linq query above completely wrong, or...?

+2  A: 

You could try using .Contains instead of .Any

Brian R. Bondy
back to that answer? that is not working :(
b0x0rz
A: 

actually everything is perfect with the query.

the problem was that i did not BUILD the solution before trying it.

what confused me was that it seems for the code behind i DO need to BUILD, but for the html/css i do not.

sorry

b0x0rz