Presentation Transcript
LINQ : LINQ .NET 3.5
Marc Vangrieken marc.vangrieken@gmail.com
http://vangrieken.wordpress.com
What is Linq? : What is Linq?
Introduction to C# 3.0 : Introduction to C# 3.0
Introduction to C# 3.0Collection Initializers : Introduction to C# 3.0 Collection Initializers
Introduction to C# 3.0Extension methods : Introduction to C# 3.0 Extension methods
Introduction to C# 3.0 Extension methods : Introduction to C# 3.0 Extension methods
Replacing LINQ Extension Methods : Replacing LINQ Extension Methods
Introduction to C# 3.0Type Inference : Introduction to C# 3.0 Type Inference
Introduction to C# 3.0Type Inference : Introduction to C# 3.0 Type Inference
Introduction to C# 3.0Anonymous types : Introduction to C# 3.0 Anonymous types
Introduction to C# 3.0Automatic Properties : Introduction to C# 3.0 Automatic Properties
Introduction to C# 3.0Lambda expressions : Introduction to C# 3.0 Lambda expressions
Introduction to C# 3.0Lambda expressions : Introduction to C# 3.0 Lambda expressions
Introduction to C# 3.0 Parameters to Lambda Expressions : Introduction to C# 3.0 Parameters to Lambda Expressions
Introduction to C# 3.0 Lambda Body Can Be Single Expression or Statement Block : Introduction to C# 3.0 Lambda Body Can Be Single Expression or Statement Block
Introduction to C# 3.0 Expression Trees : Introduction to C# 3.0 Expression Trees
Introduction to C# 3.0 Expression trees : Introduction to C# 3.0 Expression trees
Linq To Objects : Linq To Objects
Linq To Objects Hello, LINQ in C# : Linq To Objects Hello, LINQ in C#
Linq To Objects Hello, LINQ in VB : Linq To Objects Hello, LINQ in VB
Linq To Objects DEMO : Linq To Objects DEMO
Linq To Objects Standard Query Operators : Linq To Objects Standard Query Operators
Linq To Objects Positional Query Operators : Linq To Objects Positional Query Operators
Linq To Objects Set Based Query Operators : Linq To Objects Set Based Query Operators
Linq To Objects Join Operators : Linq To Objects Join Operators
Linq To Objects Ordering operators : Linq To Objects Ordering operators
Linq To ObjectsConversion operators : Linq To Objects Conversion operators
Linq To Objects DEMO : Linq To Objects DEMO
Linq To Objects Projection: Creating New Types To Hold Query Results : Linq To Objects Projection: Creating New Types To Hold Query Results
Linq To Objects Projection That Creates a Nested 1-Many Collection : Linq To Objects Projection That Creates a Nested 1-Many Collection
Linq To Objects LINQ Queries Are Lazy : Linq To Objects LINQ Queries Are Lazy
Linq To Objects Modifying a Query Before Execution : Linq To Objects Modifying a Query Before Execution
Linq To Objects You are always working with IEnumerable : Linq To Objects You are always working with IEnumerable
Linq To Sql : Linq To Sql
Linq To SqlHello, Linq To Sql : Linq To Sql Hello, Linq To Sql
Linq To SqlEverything is SQL : Linq To Sql Everything is SQL
Linq To SqlWhen does the query go to the database? : Linq To Sql When does the query go to the database?
Linq To SqlObject Model : Linq To Sql Object Model
Linq To SqlObject Model : Linq To Sql Object Model
Linq To SqlObject Model : Linq To Sql Object Model
Linq To SqlObject Model : Linq To Sql Object Model
Linq To SqlObject Model : Linq To Sql Object Model
Linq To SqlDataContext : Linq To Sql DataContext
Linq To SqlDataContext : Linq To Sql DataContext
Linq To SqlDataContext : Linq To Sql DataContext
Linq To SqlRetrieving data : Linq To Sql Retrieving data
Linq To SqlObject Identity : Linq To Sql Object Identity
Linq To SqlRelations : Linq To Sql Relations
Linq To SqlEager loading / prefetching : Linq To Sql Eager loading / prefetching
Linq To Sql Updating data : Linq To Sql Updating data Inserting
InsertOnSubmit(entity)
InsertAllOnSubmit(entityCollection)
Constraints are not checked early, queries are always sent to the database.
Updating
SubmitChanges()
Deleting
DeleteOnSubmit(entity)
DeleteAllOnSubmit(entityCollection)
Not implemented very well...
Linq To Sql Cascading deletes : Linq To Sql Cascading deletes Cascading delete = delete child rows when you delete a parent
Cascading delete constraints are allowed in the DB
But LINQ to SQL ignores them
Do it yourself
DeleteAllOnSubmit(Children)
DeleteOnSubmit(Parent)
Linq To Sql Updating data : Linq To Sql Updating data After SubmitChanges() is called
Modified objects in the object graph are identified.
New objects to be inserted
Retrieved objects to be deleted
Retrieved objects whose persistent members have changed
Changes are ordered based on foreign key constraints.
Insert, update and delete statements are constructed with modified current values in the set clause and original values in the where clause for optimistic concurrency conflict detection
Database connection is opened and a transaction is started.
If there are any errors, the transaction is rolled back.
If the transaction succeeds, the internal state of the DataContext is changed accordingly.
Database-generated columns like autoincrement / GUID keys and timestamps are propagated back to the objects
Linq To Sql Updating data : Linq To Sql Updating data
You can inspect the changes that are tracked by the datacontext before submitting.
ChangeSets
public sealed class ChangeSet
{
public IList
Catch the
buzz on authorSTREAM
Copyright © 2002-2008 authorSTREAM. All rights reserved.