Asp.net c# mvc Training-Day-5 of Day-9
-
Upload
ahm-pervej-kabir -
Category
Software
-
view
108 -
download
0
Transcript of Asp.net c# mvc Training-Day-5 of Day-9
AHM Pervej KabirAnalyst Programmer
Cell:+8801757051005 Day-5: 18 October 2017
ASP.Net C#- MVC-5 Training
Introduction
What is LINQ?
Why LINQ?
LINQ Query & Method Syntax
Anatomy of the Lambda Expression
Standard Query Operators:
Expression in LINQ
Expression Tree
Immediate Execution of LINQ Query
let & into keyword
Sample LINQ Queries
What Is LINQ
LINQ (Language Integrated Query) is uniform query syntax in C# and VB.NET used to save and retrieve data fromdifferent sources. It is integrated in C# or VB, thereby eliminating the mismatch between programming languages anddatabases, as well as providing a single querying interface for different types of data sources.
For example, SQL is a Structured Query Language used to save and retrieve data from a database. In the sameway, LINQ is a structured query syntax built in C# and VB.NET used to save and retrieve data from different typesof data sources like an Object Collection, SQL server database, XML, web service etc.
LINQ always works with objects so you can use the same basic coding patterns to query and transform data inXML documents, SQL databases, ADO.NET Datasets, .NET collections, and any other format for which a LINQprovider is available.
Why LINQ?
Familiar language: Developers don’t have to learn a new query language for each type ofdata source or data format.
Less coding: It reduces the amount of code to be written as compared with a moretraditional approach.
Readable code: LINQ makes the code more readable so other developers can easilyunderstand and maintain it.
Standardized way of querying multiple data sources: The same LINQ syntax can beused to query multiple data sources.
Compile time safety of queries: It provides type checking of objects at compile time.
IntelliSense Support: LINQ provides IntelliSense for generic collections.
Shaping data: You can retrieve data in different shapes.