linq for sql

17
LINQ for SQL SQL Saturday May 2009 David Fekke

Upload: kylie-bauer

Post on 31-Dec-2015

59 views

Category:

Documents


0 download

DESCRIPTION

LINQ for SQL. SQL Saturday May 2009 David Fekke. Who am I?. David Fekke [email protected] Software Engineer at LPS Reformed DBA/Sharepoint developer JaxFusion.org. LINQ Language Integrated Query. ORM or Object Relational Mapper. .NET 3.5 Framework. SQL vs. LiNQ. Abstraction. - PowerPoint PPT Presentation

TRANSCRIPT

LINQ for SQLSQL Saturday May 2009

David Fekke

Who am I?

•David Fekke

[email protected]

•Software Engineer at LPS

•Reformed DBA/Sharepoint developer

•JaxFusion.org

LINQLanguage Integrated

Query

ORMor

Object Relational Mapper

.NET 3.5 Framework

SQL vs. LiNQ

Abstraction

SQL Server 2005/8

•MySQL

•PostgreSQL

•Other RDBMS supported by Open Source

Oracle ProviderThrough DevArt

IQueriable Interface

•Query Objects

•Query XML

•Query Databases

var myQuery = from p in db.people where p.firstname == “David” select p

LINQ makes use .NET 3.5

language features

C# 3.0VB .NET 9.0

Lamda ExpressionsAnonymous Types

Dynamic Types

Pros and Cons• Visual Studio Generates Object code

•No reason to create separate queries for each RDBMS

• Auto parametrize variables

•Use Stored Procedures

•No hinting

• careful about in memory querying

• SQL Statements are auto-generated with the exception of Stored Procs