31 blog posts tagged LINQ

MAR
2
2021
Development4 minutes

Creating OR expressions in LINQ

As everybody who has read my blog before knows, I love LINQ and miss it when coding in other languages, so it's nice when I get a chance to use it again. When I come back to it with fresh eyes, I notice some things aren't as easy as they should be - and this time is no exception.

SEP
4
2014
Development3 minutes

Optimizing Sum, Count, Min, Max and Average with LINQ

LINQ is a great tool for C# programmers letting you use familiar syntax with a variety of back-end systems without having to learn another language or paradigm for many query operations.

MAY
21
2010
Development4 minutes

Include for LINQ to SQL (and maybe other providers)

It’s quite common that when you issue a query you’re going to want to join some additional tables.

JAN
11
2010
Development5 minutes

LINQ to SQL tips and tricks #3

Another set of useful and lesser-known LINQ to SQL techniques.

A query plan in SQL Management Studio
DEC
13
2009
Development2 minutes

SQL Server query plan cache: what is it and why should you care?

SQL Server like all databases goes through a number of steps when it receives a command. Besides parsing and validating the command text and parameters it looks at the database schema, statistics and indexes to come up with a plan to efficiently query or change your data.

NOV
6
2009
Development8 minutes

Multiple outputs from T4 made easy: revisited

My multiple outputs from t4 made easy post contained a class making it easy to produce multiple files from Visual Studio’s text templating engine (T4).

Thumbnail of the LINQ to SQL Cheat Sheet PDF
AUG
12
2009
Development1 minutes

LINQ to SQL cheat sheet

A two-page PDF reference for LINQ to SQL — one page for C# and one for VB.NET — covering common query operations, manipulations, and attributes.

JUN
24
2009
Development6 minutes

Client-side properties and any remote LINQ provider

David Fowler on the ASP.NET team and I have been bouncing ideas about how to solve an annoyance using LINQ:

JUN
4
2009
Development4 minutes

LINQ to SQL resources

A quick round-up of some useful LINQ to SQL related resources that are available for developers. I’ve not used everything on this list myself so don’t take this as personal endorsement.

JUN
1
2009
Development4 minutes

LINQ to SQL changes in .NET 4.0

People have been asking via Twitter and the LINQ to SQL forums so here’s a list I put together on a number of the changes made for 4.0.

APR
12
2009
Development3 minutes

LINQ to SQL tips and tricks #2

A few more useful and lesser-known tips for using LINQ to SQL.

MAR
16
2009
Development3 minutes

LINQ to SQL tips and tricks #1

Being on the inside of a product team often leads to uncovering or stumbling upon lesser-known techniques, and here are a few little nuggets I found interesting. I have more if there is interest.

JAN
19
2009
Development1 minutes

LINQ to SQL templates updated, now on CodePlex

My templates that allow you to customize the LINQ to SQL code-generation process (normally performed by SQLMetal/LINQ to SQL classes designer) have been updated once again.

State Pattern class diagram
JAN
5
2009
Development5 minutes

Changing type, the state pattern and LINQ to SQL

A question I see from time-to-time on LINQ to SQL relates to changing an entity’s class.

OCT
31
2008
Development3 minutes

LINQ to SQL next steps

There has been a flurry of posts and comments in the last 24 hours over the future of LINQ to SQL so I thought it would be interesting to provide some information on what the LINQ to SQL team have been up to and what we’re working on for .NET Framework 4.0.

SEP
14
2008
Development5 minutes

LINQ to SQL template for Visual Studio 2008

Detailed reference for my T4-based LINQ to SQL template — a customisable, designer-compatible replacement for SQLMetal supporting inheritance, VB.NET, composite keys, and stored procedure CRUD with concurrency.

JUL
30
2008
Development4 minutes

LINQ to SQL log to debug window, file, memory or multiple writers

The Log property on a LINQ to SQL data context takes a TextWriter and streams out details of the SQL statements and parameters that are being generated and sent to the server.

JUL
23
2008
Development2 minutes

LINQ to SQL T4 template reloaded

The topic of modifying the code generation phase of LINQ to SQL comes up often and the limited T4 template I published here last month was good at showing the potential but wasn’t a practical replacement for the code generation phase.

JUN
25
2008
Development2 minutes

Experimental LINQ to SQL template

A 369-line T4 template that generates a LINQ to SQL DataContext and entity classes from a SQL Server schema, offered as a proof-of-concept alternative to the un-customisable SQLMetal tool.

APR
10
2008
Development2 minutes

Using LINQ to foreach over an enum in C#

A tiny LINQ-powered helper that lets you foreach over enum values in C# without the verbose `Enum.GetValues(typeof(X)).Cast<X>()` incantation.

APR
1
2008
Personal2 minutes

Joining the LINQ to SQL team at Microsoft

I’ve been quiet on my blog lately largely because I have been preparing to change job and relocate half-way around the world to Vancouver in the beautiful province of British Columbia (where I spent my 2004 summer holiday).

JAN
29
2008
Development1 minutes

Language Integrated Query: An introduction presentation online

This evening’s presentation on Language Integrated Query (LINQ) is now available from my appearances page.

JAN
28
2008
Development1 minutes

Language Integrated Query: An introduction talk tomorrow

I’m just finishing up the slides, notes and writing code samples for my LINQ presentation at the Guernsey Software Developer Forum tomorrow evening.

JAN
5
2008
Development1 minutes

LINQ presentation at Guernsey Developer Forum

I will be giving a talk at the Guernsey Software Developer Forum at the end of the month on Microsoft’s new Language Integrated Query (LINQ) with particular emphasis on the capabilities and object-relational mapping characteristics of LINQ to SQL.

SEP
3
2007
Development2 minutes

LINQ in 60 seconds

Microsoft’s Language INtegrated Query (LINQ) aims to provide a way of selecting objects with a common syntax independent of the data source.

AUG
2
2007
Development3 minutes

Partial methods in .NET 3.5, overview and evolution

One of the interesting new things in .NET 3.5 is partial methods which are now being used extensively by LINQ to SQL and no-doubt will be Microsoft’s corner-post of extensibility for generated classes. Here’s a quick overview:

JUN
26
2007
Development6 minutes

CodeSmith template to generate LINQ To SQL Data Context

If you are interested in what LINQ to SQL generates and don’t have Orcas installed or available right now but use CodeSmith try the following template to generate very similar code.

JUN
20
2007
Development3 minutes

Discarding new entity objects in LINQ to SQL beta 1

An unusual bug in .NET Framework 3.5 beta 1 that relates to creating a new entity object in LINQ to SQL has been getting in my way.

JUN
11
2007
Development2 minutes

LINQ to SQL NullReferenceException on SubmitChanges

I’ve been busy working on some LINQ to SQL (formerly DLINQ) apps that have been going well bar a NullReferenceException thrown at me from deep in the bowels of LINQ and it’s change tracker. A cursory glance in debug showed none of the properties that represent columns were null…

MAY
16
2007
Development4 minutes

LINQ to SQL details, issues and patterns

LINQ to SQL (formerly called DLINQ) is a simple object-relational mapper (ORM) scheduled for .NET Framework 3.5/Visual Studio 2007 (Orcas).

Window of the LINQ To SQL templates available
JAN
6
2007
Development1 minutes

LINQ in C# Web Applications

I’m a big fan of the Web Application type that was previously available as an add-on to Visual Studio 2005 but it got promoted to a standard citizen with Service Pack 1.