A List of LINQ Providers

 

LINQ Providers

Via http://blogs.msdn.com/charlie/archive/2006/10/05/Links-to-LINQ.aspx

LINQ to SQL vs LINQ to Entities

 

When Do I Use LINQ to SQL?

The primary scenario for using LINQ to SQL is when building applications with a rapid development cycle and a simple one-to-one object to relational mapping against the Microsoft SQL Server family of databases. In other words, when building an application whose object model is structured very similarly to the existing database structure, or when a database for the application does not yet exist and there is no predisposition against creating a database schema that mirrors the object model; you can use LINQ to SQL to map a subset of tables directly to classes, with the required columns from each table represented as properties on the corresponding class. Usually in these scenarios, the database has not and/or will not be heavily normalized.

image

When do I use LINQ to Entities?

The primary scenario targeted by LINQ to Entities is a flexible and more complex mapping scenario, often seen in the enterprise, where the application is accessing data stored in Microsoft SQL Server or other-third party databases.

In other words, the database in these scenarios contains a physical data structure that could be significantly different from what you expect your object model to look like. Often in these scenarios, the database is not owned or controlled by the application developer(s), but rather owned by a DBA or other third party, possibly preventing application developers from making any changes to the database and requiring them to adapt quickly to database changes that they may not have been aware of.

image

Via Introducing LINQ to Relational Data

Kigg – Building a Digg Clone with ASP.NET MVC Part – 1

 

Learn how to develop a Digg-like application with ASP.NET MVC, LINQ to SQL and ASP.NET AJAX.

Introduction

For the last few days, I have been trying to get my hands dirty with the new ASP.NET MVC framework. I saw many discussions on some of the advanced topics like IoC Container/DI, View Engine, Controller factory and so on, but I could not find a simple application to harness the power of the new ASP.NET MVC framework. Certainly, knowing these things is an added benefit but it is not mandatory to develop applications with the ASP.NET MVC Framework. In this article – from the DotNetSlackers team – I will present a basic version of Digg / DotNetKicks kind of application developed with the ASP.NET MVC framework. You will find the whole application running at the following link:

[Live Demo]

image

Kigg – Building a Digg Clone with ASP.NET MVC Part – 1

ASP.NET MVC Framework Scaffold Generator

 

great new Free tool called  “ASP.NET MVC Framework Scaffold Generator ”
Its a Freeware tool that automatically creates CRUD ( Create, Read, Update, Delete ) pages for the new Asp.Net MVC Framework. A Right tool at the right time indeed.

Features:

  • Uses the LinqToSql data to generate source code.

You can download it here.
You can also watch the screencast here.

Creating custom LINQ provider using Open Source – LinqExtender

 

Mehfuz shows how to create a custom LINQ provider using the open source project LINQExtender.

In my previous article – LINQ provider basics – I have explained how LINQ to Entity work. I used examples mostly from my LINQ.Flickr project. Although creating a provider is fun, there are some repetitive tasks along the way, like expression processing and data extraction. Therefore things could be much easier with a common framework that takes care of complexes and monotonous tasks, while developers are presented with a simple model, by which they can get going with their providers without any expression overhead.

LinqExtender exposes such model, which lets the developer focus only on the application logic – not on the query internals – while creating custom home made providers. It sits between the core LINQ framework and a custom provider.

Creating custom LINQ provider using LinqExtender

LINQ let Keyword

 

The new keyword “let” which is used inside LINQ queries to create temporarily variables.

check this out

var list = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
var query = from i in list
            let j = i + 2
            let k = j * j
            select new { i, j, k };

As you can see the let keyword was used to create two new temp variables (j, k) which their values were calculated inside the query.

Also with let query clauses, you can introduce a variable into scope and use it in the subsequent query clauses. Similar to local variables in a method body, this gives you a way to avoid evaluating a common expression multiple times by storing it in a variable.

For instance, inexperienced Linq developer quickly codes up a query that looks like this:

var nameList = new List<string>
                   {
                       "Matt",
                       "Adam",
                       "John",
                       "Peter",
                       "Owen",
                       "Steve",
                       "Richard",
                       "Chris"
                   };
var vowels = new List<string> {"A", "E", "I", "O", "U"};
var names = (from p in nameList                                                  
            where
            (vowels.Any(v => p.ToUpper().StartsWith(v)) 
            || vowels.Any(v => p.ToUpper().EndsWith(v))) &&
            (p.Length == 4 
            || p.Length == 5)
            select p).ToList();

 

Using “let”, we can define four intermediate variables that hold our vowels and booleans for our tests, then in the where clause we just check our boolean values:

var names = (from p in nameList
            let vowels = new List<string> { "A", "E", "I", "O", "U" }
            let startsWithVowel = vowels.Any(v => p.ToUpper().StartsWith(v))
            let endsWithVowel = vowels.Any(v => p.ToUpper().EndsWith(v))
            let fourCharactersLong = p.Length == 4
            let fiveCharactersLong = p.Length == 5
            where
            (startsWithVowel || endsWithVowel) &&
            (fourCharactersLong || fiveCharactersLong)
            select p).ToList();
 

LINQPad

LINQPad supports everything in C# 3.0 and Framework 3.5:

  • LINQ to SQL
  • LINQ to Objects
  • LINQ to XML

LINQPad is also a terrific tool for learning LINQ: it comes preloaded with 200 examples from the recently released C# 3.0 in a Nutshell.  There’s no better way to experience the coolness of LINQ and functional programming.

image

LINQ to XML RTM docs

Getting Started (LINQ to XML)

Provides introductory information about LINQ to XML, including a conceptual overview and an overview of the System.Xml.Linq classes.

Programming Guide (LINQ to XML)

Provides conceptual and how-to information about programming with LINQ to XML.

Reference (LINQ to XML)

Provides pointers to the LINQ to XML managed reference documentation.

Samples (LINQ to XML)

Provides sample applications for LINQ to XML.