Why we need LINQ? tho it’s also generating query in background and executing in SQL, that we can do manually.
Any real time example would be appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For SQL, you don’t particularly need LINQ. You could do all the same stuff it does if you wanted to. It just happens to be more convenient with LINQ in a couple of ways:
You end up with an
IEnumerablethat you don’t have to care about the inner workings of. Just iterate over it much as you would a list or array. No code required to fetch rows, update cursors, etc.From a consumer’s point of view, that
IEnumerableworks the same as a query on objects, which is one of the places where LINQ really shines. You can replace one with the other, and the rest of the code need never know.