Explain how you can retrieve a single row with LINQ?

Answer

To retrieve a single row with LINQ we need

Public User GetUser (string userName)

{

DBNameDataContext myDB = new DBNameDataContext ( ) ;

User user = myDB. Users. Single ( u, u.UserName => userName );

Return user;

}

All linq Questions

Ask your interview questions on linq

Write Your comment or Questions if you want the answers on linq from linq Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---