Introduction Of Linq , ASP.NET Training Ahmedabad
-
Upload
nichetech-com-solutions-pvt-ltd -
Category
Education
-
view
1.116 -
download
0
Embed Size (px)
description
Transcript of Introduction Of Linq , ASP.NET Training Ahmedabad

LINQ TO SQL
http://www.nichetechsolutions.com/
http://www.mcaprojecttraining.com/

LINQ TO SQL
Prepared By: Nilesh R. Parmar

Introduction How LINQ works?
ArchitectureUnderline ExecutionExecution Mode
Why LINQ? LINQ to Objects LINQ to SQL Select in LINQ Insert in LINQ Update in LINQ Delete in LINQ
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

Language Integrated Query
A set of language extensions that allows you to perform queries without leaving the comfort of the programming language (C# or VB)
Defines keywords that you use to build query expressions like select, from and where
Select, filter, sort, group or transforms the data
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

var contacts = from c in customers where c.State == "WA" select new { c.Name, c.Phone };
var contacts = customers .Where(c => c.State == "WA") .Select(c => new { c.Name, c.Phone });
Extension Extension methodsmethods
Lambda Lambda expressionsexpressions
Query Query expressionsexpressions
Object Object initializersinitializers
Anonymous Anonymous typestypes
Local Local variable type variable type inferenceinference
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

Deferred Execution
var data = from d in ibEntity.Tourists
where d.IsIBMember == true select d;
inMemoryData = data.ToList();
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

Immediate Execution
var city = ( from c in inMemoryData
select (c.City.ToUpper())
).Distinct();
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

Unifies the way of accessing data from different data sources.
Compile-time checking of all queries, reduces run time errors.
Strongly typed.
Can be applied in any project layer (UI/Business/Data)
Extensive Intellisence/Debugging support.
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

Query can be executed on collections & objects that implements IEnumerable interface.
LINQ queries Vs. foreach loops:
Concise and readable, especially when filtering multiple conditions.
Provides powerful filtering, ordering, and grouping capabilities with a minimum of application code.
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

Query data in the SQL Server Database
Implicitly transforms LINQ expression into a set of SQL queries
Advantages: Flexibility Change Tracking & Batch Updates Less code
NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C

NicheTech Computer Solutions Pvt. Ltd Prepared By: Nilesh R. Parmar C
