Your SlideShare is downloading. ×
Linq view part1
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Linq view part1

1,061

Published on

The first part of a series of workshops about linq. …

The first part of a series of workshops about linq.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,061
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Microsoft LinqInsightspart 1
    A tech overview
    Alexandre Marreiros, 2011
  • 2. Agenda
    Alexandre Marreiros, 2011
    Using LINQ
    References
    Contacts
    Pre-Requirements
    Introduction
    LINQ Principles
    Query
  • 3. Introduction
    Alexandre Marreiros, 2011
    Linq acronym for: Language Integrated Query
    It extends .NET to access Data in a easy and integrated way to CLI Languages.
    Almost anything can be a DataSource to Linq.
    Data Sources
    Linq
    .Net Framework
    WPF
    WCF
    WWF
    WPF
    .Net Framework
  • 4. Introduction
    LINQ extends CLI languages with the power to querying data, directly.
    Avaiable to VB.net and C#.
    .NET Standard to query multiple data sources.
    Declarative style of programming.
    Support for multithread programming.
    Alexandre Marreiros, 2011
  • 5. Introduction
    Alexandre Marreiros, 2011
  • 6. Demo
    Alexandre Marreiros, 2011
    Presenting Query expression, LINQ to Object and LINQ to SQL
  • 7. LINQ Principles
    Alexandre Marreiros, 2011
    LINQ key Ideas are:
    Integrated;
    Declarative;
    Unitive;
    Extendable;
    Hierarchical;
    Composable;
  • 8. LINQ Principles
    Alexandre Marreiros, 2011
    Integrated
    One of the main goals of LINQ is to integrate a flexible query sintax in to .NET languages.
    Querying data in .net can be confused and tricky theres an example:
    SqlConnection connection = new SqlConnection(connectionString);
    connection.Open();
    System.Data.SqlClient.SqlCommand sqlCommand = new SqlCommand();
    sqlCommand.Connection = connection;
    sqlCommand.CommandText = "Select * from Customer";
    sqlCommand.ExecuteReader(CommandBehavior.CloseConnection);
  • 9. LINQ Principles
    Alexandre Marreiros, 2011
    Integrated
    LINQ offers a mutch more integrated mode and code cust effective.
    Querying in LINQ:
    Contacts DB = new Contacts(@c:Contacts.mdf);
    var query = from contact in DB.Contacts;
    select c;
  • 10. LINQ Principles
    Alexandre Marreiros, 2011
    Unitive
    Without LINQ a data driven programs will have in the same code a mix off different technologies
    Just LINQ
    Just #
    SQL
    C#
    And, OR
    XML
    Parsing
    C#
  • 11. LINQ Principles
    Alexandre Marreiros, 2011
    Extendable
    LINQ is a technologie based in providers.
    You Can extend LINQ Implementing new Providers.
    All providers are adressed with the same syntax.
  • 12. LINQ Principles
    Alexandre Marreiros, 2011
    Declarative
    varqueryNames = from realNamein names
    where realName != ""
    select realName;
    Focus in What You Want
    Not In How you do
  • 13. LINQ Principles
    Alexandre Marreiros, 2011
    Hierarchical
  • 14. LINQ Principles
    Alexandre Marreiros, 2011
    Composable
    Query can be composed from other queties
  • 15. Demo
    Alexandre Marreiros, 2011
    A FewqueryExamplesmadefromtheroots
  • 16. Using Linq
    Use Linq to easy query datasources as databases, object collections, XML, Excel Files and others.
    Extend Linq to support aditional datasources.
    In database or business service Layers use Linq to reduce Complexity.
    Don´t throw away ADO.NET in data relational database think if he can be a best Aproach.
    Alexandre Marreiros, 2011
  • 17. Commingnext
    NowthatwealreadyunderstandWhat´s LINQ inthenextpartwewillseehow to use thedifferent LINQ model’s.
    (LINQ to SQL, LINQ to XML, LINQ to Object,How to extend LINQ, LINQ to Sharepoint)
    Alexandre Marreiros, 2011
  • 18. Alexandre Marreiros, 2011
    References
    http://msdn.microsoft.com/en-us/netframework/aa904594Http://download.microsoft.com/download/4/7/0/4703eba2-78c4-4b09-8912-69f6c38d3a56/LINQ.wmvLinq in Action – Fabrice MargueirePro Linq Language integrated query 2010 in c# 2010 – Joseph C. RattzProgramming Microsoft ASP.NET 3.5 – Dino Esposito
  • 19. Contacts
    Alexandre Marreiros, 2011
    Email: Amarreiros@gmail.com
    Twitter: @alexmarreiros
    Feel free to ask

×