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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -