Hello there for im use Linq to check that if two user fields register a unique user in SQL table For example,
UID: User ID PIN: PassID
Then the field should be from the same user, I was trying this:
< Pre> Public Bull AutentificacionUsuario (string userID, string password pass ID) {USER _userID = _db.USER.FirstOrDefau Lt (uid = & gt; UID.Siglas == User ID); USER _passID = _db.USER.FirstOrDefault (pwd = & gt; pwd.codigousuario == passID);
But both give a user table frequency from a datacentext (two instead of one), I want to match them in Lambda expression such as "this userID match pass-id"
Thanks!
var usr = db.Users.fr (UID => uid.dsiglas = = UserID & UID codigousuario == PAIID) .FirstOrDefault (); If (usr! = Null) // validate the user here
or
var usr = (from db to u.us where u.dsiglas == User ID & amp; UID Codgysiario == SelectID of CID). FirstOver Default () if (USR! = Null) // Authenticate User Here
Comments
Post a Comment