wcf - Checking for Linq Variables -
i m making wcf service login. code accesssing db data using linq :
var result = detail in dc.tbl_user_masters detail.user_type_id == 2 select new userverification { uname = detail.user_login_name, password = detail.user_pwd };
where userverification class has uname , password properties stored..now how check variable if null we'll not allow login...i dont know how linq..
you need filter on user/password you're trying authenticate:
var givenuname = "robertpaulson"; var givenpassword = "bob"; var result = ( detail in dc.tbl_user_masters detail.user_type_id == 2 detail.user_login_name == givenuname && detail.user_pwd == givenpassword select detail ).singleordefault();
now result
either null
or have details authenticated user.
Comments
Post a Comment