Online E-Books Links
ASP.NetC-SharpVB.Net SQL ServerAJAXXML
Showing posts with label LINQ. Show all posts
Showing posts with label LINQ. Show all posts

Why select clause comes after from clause in LINQ?

LINQ is used with C# or other programming language, which requires all the variables to be declared first. From clause of LINQ query just defines the range or conditions to select records. That’s why select clause comes after from clause in LINQ

What is a Lambda Expression?

A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types. All lambda expressions use the lambda operator =>, which is read as goes to.
Lambdas are used in method-based LINQ queries as arguments to standard query operator methods e.g. Where.

How LINQ is beneficial than Stored procedure?

Some of the benefit of LINQ over stored procedures.
1. Debugging - It is really very hard to debug the Stored procedure but as LINQ is part of .NET, you can use visual studio's debugger to debug the queries.
2. Deployment - With stored procedures, we need to provide an additional script for stored procedures but with LINQ everything gets complied into single DLL hence deployment becomes easy.
3. Type Safety - LINQ is type safe, so queries errors are type checked at compile time. It is good to encounter an error when compiling rather than runtime exception!

What is LINQ?

LINQ stands for Language Integrated Query. Language-Integrated Query defines a set of general purpose standard query operators that allow traversal, filter, and projection operations to be expressed in a direct yet declarative way in any .NET-based programming language. The standard query operators allow queries to be applied to any IEnumerable based information source. LINQ allows third parties to augment the set of standard query operators with new domain-specific operators that are appropriate for the target domain or technology. More importantly, third parties are also free to replace the standard query operators with their own implementations that provide additional services such as remote evaluation, query translation, optimization