Introduction to LINQ Lecture # 19 August 2 2013. Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free.

Slides:



Advertisements
Similar presentations
Developer Knowledge Sharing Eric Sun Dec, What programming language did you learn in school and since then? Now, its time to refresh …
Advertisements

The Microsoft Technical Roadshow 2007 Language Enhancements and LINQ Daniel Moth Developer & Platform Group Microsoft Ltd
Language Integrated Query (LINQ) Martin Parry Developer & Platform Group Microsoft Ltd
What is a Database By: Cristian Dubon.
LINQ and Collections An introduction to LINQ and Collections.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
C# 3.0 & LINQ Raimond Brookman – IT Architect
LinqToSharePoint SandBoxed Solution Shakir Majeed Khan
Damien Guard (BSc, MBCS) Guernsey Software Developer Forum Language Integrated Query:
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
C# 3.0 Tom Roeder CS fa. Version 3 From PDC 2005 preview compiler available LINQ: language-integrated query High level points: adds native query.
Visual Studio 2008 and ASP.NET 3.5 Mike Ormond Developer & Platform Group Microsoft Ltd
The Microsoft Technical Roadshow 2007 Advances for Data in VS “Orcas” Mike Taulty Developer & Platform Group Microsoft Ltd
What’s new in ASP.NET 3.5? Mike Ormond Developer & Platform Group Microsoft Ltd
Objective In this session we will discuss about : What is ADO. NET ?
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
Discover, Master, InfluenceSlide 1 SQL Server Compact Edition and the Entity Framework Rob Sanders Readify.
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
Introduction to ADO Entity Framework ir Denis VOITURON Source:
XML files (with LINQ). Introduction to LINQ ( Language Integrated Query ) C#’s new LINQ capabilities allow you to write query expressions that retrieve.
LINQ Programming in C# LINQ CSE Prof. Roger Crawfis.
 Introduction  What is LINQ  Syntax  How to Query  Example Program.
Slides from Gang Luo, Xuting Zhao and Damien Guard
LINQ Boot Camp ADO.Net Entity Framework Presenter : Date : Mahesh Moily Nov 26, 2009.
Entity Framework MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
Compiling Mappings to Bridge Applications and Databases Melnik, Adya and Research.
Putting it all together: LINQ as an Example. The Problem: SQL in Code Programs often connect to database servers. Database servers only “speak” SQL. Programs.
Entity Framework Overview. Entity Framework A set of technologies in ADO.NET that support the development of data-oriented software applications A component.
1 Hammad Khan. COURSE CONTENTS.NET Framework And C# SQL Server 2008 ADO.NET LINQ ASP.NET Dynamics Data ASP.NET MVC framework 2 Advance C# Concepts Windows.
LINQ and C# 3.0 Mads Torgersen Program Manager for the C# Language Microsoft Corporation.
LINQ: It’s Not Your Father’s Data Access Denny Boynton Anheuser-Busch Companies.
The.NET Language Integrated Query Project Anders Hejlsberg TLN306 Technical Fellow Microsoft Corporation.
 Language Integrated Query  Make query a part of the language  Component of.NET Framework 3.5  Shipped with Visual Studio 2008.
LINQ Providers Or why.NET rules, and Java doesn’t Branimir Giurov SofiaDev.org UG Lead, C# MVP Freelance Software Developer
Objectives In this lesson, you will learn to: *Identify the need for ADO.NET *Identify the features of ADO.NET *Identify the components of the ADO.NET.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 14 Using Relational Databases to Provide Object Persistence (Overview) Modern Database.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Oct * Brad Tutterow. VS 2008.NET 3.5LINQ Entity Framework  The ADO.NET Entity Framework is part of Microsoft’s next generation of.NET technologies.
EntityFrame work and LINQ CH 14. linq LINQ enables you to query data from a wide variety of data sources, directly from your programming code. LINQ is.
ADO.Net TableAdapters and TableAdapterManager Code Camp 2008 Emmet Gray
Course FAQ’s I do not have any knowledge on SQL concepts or Database Testing. Will this course helps me to get through all the concepts? What kind of.
AUC Technologies LINQ (Language Integrated Query) LINQ Presented By : SHAIKH SHARYAR JAVED Software Engineer (Daedalus Software Inc.) Technology Teacher.
Language Integrated Query (LINQ). Data Access Programming Challenges Developers must learn data store-specific query syntax Multiple, disparate data stores.
By: Luis Carranco CIS764 - Fall  What is LINQ  Architecture  How does it work?  Samples/Demo  Why to use LINQ? 2.
C#: Future Directions in Language Innovation Anders Hejlsberg TLN307 Technical Fellow Microsoft Corporation.
Applied Linq Putting Linq to work Introducing… Class-A Kennisprovider Microsoft development Training Coaching Alex Thissen Trainer/coach.
Satisfy Your Technical Curiosity C# 3.0 Raj Pai Group Program Manager Microsoft Corporation
Linq Overview Vincent GERMAIN. Evolution - Rappel Langage  C# 2.0  C# 3.0 (Local type inference, Lambda expression, Method extension,Anonymous type)
Damien Guard (BSc, MBCS) Guernsey Software Developer Forum Language Integrated Query:
Joel Pobar Language Geek Microsoft DEV320 Improve on C# % Backwards Compatible Language Integrated Query (LINQ)
LINQ Language Integrated Query LINQ1. LINQ: Why and what? Problem Many data sources: Relational databases, XML, in-memory data structures, objects, etc.
Ken Casada Developer Evangelist Microsoft Switzerland
ADO.NET 3.0 – Entity Data Model Gert E.R. Drapers Chief Software Architect Visual Studio Team Edition for Database Professionals Microsoft Corporation.
Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd
Introduction to.NET Florin Olariu “Alexandru Ioan Cuza”, University of Iai Department of Computer Science.
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
Introduction to Entity Framework
Language Integrated Query: (LINQ) An introduction
Entity Framework By: Casey Griffin.
ADO.NET Entity Framework
Language Integrated Query (LINQ)
Visual Studio “Orcas” & .NET Framework v3.5
Language Integrated Query (LINQ)
Data Model.
Contents Preface I Introduction Lesson Objectives I-2
Chapter 8 Advanced SQL.
ADO.NET Entity Framework
LINQ - 2 Ravi Kumar C++/C# Team.
CS4540 Special Topics in Web Development LINQ to Objects
Presentation transcript:

Introduction to LINQ Lecture # 19 August

Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free manner? What if you could use a consistent querying syntax for data, objects or XML?

Agenda What is LINQ Queries without LINQ Key features of LINQ LINQ Architecture LINQ to…

Introduction We use many different types of query – SQL, XQuery/XPath, DataView row filters, etc. Maybe we could enhance productivity by... – Deciding on one query expression syntax – Enabling compilers to check queries & results – Allow extensibility to target all kinds of data

What is LINQ? Language Integrated Query Make query a part of the language Component of.NET Framework 3.5

Queries without LINQ foreach(Customer c in customers) if (c.Region == "USA")... Objects using loops and conditions XML using XPath/XQuery SELECT * FROM Customers WHERE Region='USA' SELECT from database tables

Language Innovations var contacts = from c in customers where c.City == "Hove" select new { c.Name, c.Phone }; var contacts = customers.Where(c => c.City == "Hove").Select(c => new { c.Name, c.Phone }); Extension methods Lambda expressions Query expressions Object initializers Anonymous types Local variable type inference

Key Features of LINQ Delayed Execution  LINQ queries don't execute until they must Retrieve specific values Iterate through the collection Perform an operation Write Data Access Code directly Compile time syntax and schema checking (intellisense too) no need of inline sql or to wait until runtime to see if it is ok LINQ data access code abstracted from underlying data consistent syntax across various data sources can join information from different sources.

Architecture Compilers (language-level support) Standard Query Operators Expression Trees Linq-enabled data sources Linq to objects Linq-enabled ADO.NET Linq to SQL (DLinq) Linq to datasets Linq to entities Linq to XML (XLinq)

LINQ to… LINQ to Objects LINQ to SQL (formerly known as DLINQ) LINQ to XML (formerly known as XLINQ) LINQ to Entities (ADO.NET Entities)

LINQ to Objects Query any IEnumerable source Includes arrays, List, Dictionary... Many useful operators available Sum, Max, Min, Distinct, Intersect, Union Expose your own data with IEnumerable or IQueryable Create operators using extension methods

New Language Features – LINQ to objects

LINQ to SQL (formerly known as DLinq) Object-relational mapping (ORM)  Records become strongly-typed objects.  Includes tracking of changed objects and persistence.  Ensures that you will not obtain multiple objects for the same underlying row in the database ( Fowler’s Identity Map) Data context is the controller mechanism Facilitates update, delete & insert Type, parameter and injection safe

LINQ to SQL

LINQ to XML (formerly known as XLinq) Similar to LINQ to SQL but along the idea of querying XML documents using LINQ syntax rather than the XPath/XQuery syntax.

LINQ to XML

LINQ to Entities LINQ to Entities (ADO.NET Entities)  A more advanced ORM solution that allows more extensive mapping and manipulation between how the object appears and the underlying data source.  LINQ to Entity provides Excellent build support; if it isn't mapped 100%, it won't build It works with other databases (I'm currently using it with Oracle) It properly seperates the structural model from the conceptual entity model. It maps many to many relationships properly.

LINQ to Entities

Summary Had a quick intro on  LINQ and its need  Key Language features  LINQ Architecture  LINQ Types  LINQ Operators

For more information…. Official sitehttp://msdn.microsoft.com/en-us/netframework/aa aspx Tutorialshttp://weblogs.asp.net/scottgu/archive/tags/LINQ/default.aspx 101 LINQ Sampleshttp://msdn.microsoft.com/en-us/vcsharp/aa aspx LINQ Padhttp://