Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.

Slides:



Advertisements
Similar presentations
Svetlin Nakov Director Training and Consulting Activities National Academy for Software Development (NASD) ASP.NET 3.5 New Features.
Advertisements

The Microsoft Technical Roadshow 2007 Language Enhancements and LINQ Daniel Moth Developer & Platform Group Microsoft Ltd
Ofir Aspis 1/2010 VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending.
Thomas Ball Microsoft Research. C# 3.0C# 3.0 Visual Basic 9.0Visual Basic 9.0 OthersOthers.NET Language Integrated Query LINQ to Objects LINQ to DataSets.
.NET 3.5 – Mysteries. NetFx Evolution NetFx 1.0 C# 1.0, VB 7.0, VS.NET NetFx 1.1 C# 1.1, VB 7.1, VS 2003 NetFx 2.0 C# 2.0, VB 8.0, VS 2005 NetFx 3.0 C#
FIRST LOOK AT “ORCAS” Scott Guthrie General Manager.NET Developer Platform.
.NET Technology.
LinqToSharePoint SandBoxed Solution Shakir Majeed Khan
Building a Complete Web Application Using ASP.NET 3.5 & Visual Studio 2008 (Part 1 of 2) Jeff King Program Manager Microsoft Corporation
ISYS 512 Business Application Design and Development with.Net David Chao.
Visual Studio 2008 and ASP.NET 3.5 Mike Ormond Developer & Platform Group Microsoft Ltd
What’s new in ASP.NET 3.5? Mike Ormond Developer & Platform Group Microsoft Ltd
Intro to C# Language Richard Della Tezra IS 373. What Is C#? C# is type-safe object-oriented language Enables developers to build a variety of secure.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
René Balzano Technology Solution Professional Data Platform Microsoft Switzerland Database Development with SQL Server Data Tools (SSDT)
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.
Aptech Borivali(West) Hefin Dsouza. Agenda  What is.NET and What is Visual Studio? .NET Framework 3.5 Overview.  Visual Studio 2008 Enhancements. 
Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.
Overview of Microsoft.Net and Vb.Net ITSE 2349 Spring 2002 Material from Microsoft.Net an Overview for ACC faculty by Stuart Laughton and Introduction.
 Introduction  What is LINQ  Syntax  How to Query  Example Program.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Eric Vogel Software Developer A.J. Boggs & Company.
Session 1 - Introduction and Data Access Layer
Native Support for Web Services  Native Web services access  Enables cross platform interoperability  Reduces middle-tier dependency (no IIS)  Simplifies.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
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.
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.
C# 2.0 and Future Directions Anders Hejlsberg Technical Fellow Microsoft Corporation.
Language Integrated Query (LINQ). Data Access Programming Challenges Developers must learn data store-specific query syntax Multiple, disparate data stores.
CIS 375—Web App Dev II ASP.NET 1 Getting Started.
ISYS 512 Business Application Design and Development with.Net David Chao.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd
M ICROSOFT.NET Kyle Adamski 10/15/2012. Road Map What is.NET? Common Language Runtime (CLR) Language Integrate Queries (LINQ).NET Pros.NET Cons Sources.
Introduction to.NET Florin Olariu “Alexandru Ioan Cuza”, University of Iai Department of Computer Science.
C# Diline Giriş.
Introduction ITEC 420.
Introducing the Microsoft® .NET Framework
DotNetSpider Editor Hefin Dsouza
Outline Introduction to the Phalanger System
/* LIFE RUNS ON CODE*/ Konstantinos Pantos Microsoft MVP ASP.NET
LINQ for SQL SQL Saturday May 2009 David Fekke.
.NET Framework 2.0 .NET Framework 3.0 .NET Framework 3.5
Language Integrated Query: (LINQ) An introduction
Visual Studio Tools for Office 2005
Introduction to .NET Framework Ch2 – Deitel’s Book
Did your feature got in, out or planned?
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
CE-105 Spring 2007 Engr. Faisal ur Rehman
ASP.NET 3.5 Mike Ormond Developer & Platform Group Microsoft Ltd
XAML User Interface Creation in C#
ADO.NET Entity Framework
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
An Introduction to Entity Framework
Entity Framework Core.
Visual Studio “Orcas” & .NET Framework v3.5
Language Integrated Query (LINQ)
Advances for Data in VS “Orcas”
Introducing the .NET Framework
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
Advances for Data in VS “Orcas”
ADO.NET Entity Framework
WCF Data Services and Silverlight
Visual Studio 2008.
Entity Framework & LINQ (Language Integrated Query)
.Net for Test and Measurement
Presentation transcript:

Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK

Overview LINQ = Language INtegrated Query Microsoft’s intention: Provide a solution for ORM problem Simplify and standardize the interaction between objects (= languages) and data sources Introduce declarative and functional programming into .NET languages

Why LINQ? Impedance mismatch: OOP languages, SQL, XML, etc are mixed and matched to build a rich and coherent solution They represent different paradigms and do not play well with each other

Why LINQ? OR mappers’ limitations: A good knowledge of the tools is required to use them efficiently and avoid performance issues. Optimal use still requires knowledge of how to work with a relational database. Mapping tools are not always as efficient as handwritten data-access code. Not all the tools support compile-time validation.

Before LINQ Distinct moves to data integration: SQLXML 4.0 ties SQL to XSD System.Xml spans XML/XML DOM/XSL/XPath and CLR ADO.NET API bridges SQL and CLR data types SQL Server 2005 includes CLR integration Cω, ObjectSpaces, XQuery etc.  Difficult to use together

LINQ’s Main Goals Deeply integrate the capabilities of data query and manipulation languages into programming languages Removes as many barriers as possible among objects, databases, and XML. Enables us to work with each of these paradigms using the same language-integrated facilities.

LINQ’s Other Goals Extensibility model for languages: Enable implementation for other programming languages. Extensibility model for multiple data sources: Be able to access other data sources than relational databases or XML documents. Allow other frameworks to enable LINQ support for their own needs. Type safety: Compile-time type checking to avoid problems that were previously discovered at run-time only. The compiler will catch errors in your queries. Extensive IntelliSense support (enabled by strong-typing): Assist developers when writing queries to improve productivity and to help them get up to speed with the new syntax. The editor will guide you when writing queries. Debugger support: Allow developers to debug LINQ queries step by step and with rich debugging information. Build on the foundations laid in C# 1.0 and 2.0, VB.NET 7.0 and 8.0: Reuse the rich features that have been implemented in the previous versions of the languages. Run on the .NET 2.0 CLR: Avoid requiring a new runtime and creating unnecessary deployment hassles. Remain 100% backward compatible: Be able to use standard and generic collections, data binding, existing web and Windows Forms controls, and so on.

LINQ’s Requirements LINQ’s features are a matter of compilers and libraries, not runtime: Compiler: C# 3.0 or VB.NET 9.0 Runtime: .NET 2.0 CLR (SP1 for LINQ to SQL) or later Development environment: IDE: Visual C# 2008 Express Edition Visual Basic 2008 Express Edition Visual Web Developer 2008 Express Edition Visual Studio 2008 Standard Edition or higher DB server (For LINQ to SQL): SQL Server 2005 Express Edition or SQL Server 2005 CE (included with most versions of Visual Studio) SQL Server 2005 SQL Server 2000a A later version of SQL Server9

LINQ-Related Language Enhancements Generics: List<T> Delegate: delegate Boolean FilterDelegate(A obj) Anonymous methods: delegate(Process p) { return p.WorkingSet64 >= 2 * 1024; } Iterators: yield Implicitly-typed local variables: var delta = 5 Object initializers: string[] values = {“A”, “B”} Lambda expressions: address => address.City == “Paris” Extension methods: static void Dump(this object o) Anonymous types: var mica = new {Name = “Mica”}

Example: Generic

Example: Anonymous method

Example: Iterator

Example: Implicitly-typed local variables

Example: Object initializers

Lambda Expression

Example: Lambda Expression

Example: Lambda Expression

Example: Lambda Expression

Extension Methods C# VB.NET Declared in a non-generic static class The first parameter must be of the type that is extended and preceded by the keyword this. Should be declared in a module. The method must be attributed with: Runtime.CompilerServices.Extension()

Example: Extension Methods

Example: Extension Methods

Example: Anonymous type

Language extensions – All in one Implicitly-typed local variable Lambda expression Anonymous type Object initializer Extension methods

LINQ Architecture

LINQ as Language Extensions

LINQ to Objects C# Result VB.NET

LINQ to XML (System.Xml.Linq) C# Result VB.NET

LINQ vs Traditional Ways

LINQ to SQL (System.Data.Linq.Mapping) C# Result VB.NET

References LINQ In Action, by Fabrice Maguerie - Steve Eichert - Jim Wooley, Manning

Thanks for coming. See ya!