Share via


Meta-Me

Tip 31 – How to compose L2O and L2E queries

Imagine you want to write a query like this: var possibleBuyers= from p in ctx.People where...

Author: Alex D James Date: 08/11/2009

Tip 30 – How to use a custom database function

Imagine you have a database function like the DistanceBetween function in Nerd Dinner: CREATE...

Author: Alex D James Date: 08/06/2009

Another C# trick: Fluents, Inheritance and Extension Methods

Here’s a scenario which Damien and I encountered recently. We needed a way of specifying Facets for...

Author: Alex D James Date: 07/31/2009

Tip 29 – How to avoid LazyLoad or Load() reader issues

If you have code that looks like this: var results = from c in ctx.Customers where...

Author: Alex D James Date: 07/31/2009

Some comments on efficient SOA method composition

A couple of posts back I started talking about composing SOAPY operations efficiently, by shipping...

Author: Alex D James Date: 07/31/2009

And while you are at it… why can’t I compose REST calls?

In my last post I asked why you can’t compose SOA method calls efficiently. With REST services like...

Author: Alex D James Date: 07/28/2009

Why can’t I efficiently compose method calls in SOA?

Imagine if you have these 3 methods: public Employee GetEmployee(string alias); public Department...

Author: Alex D James Date: 07/28/2009

Tip 28 - How to implement an Eager Loading strategy

Background: Over the last 2 years lots of people have complained about the way Eager loading works...

Author: Alex D James Date: 07/24/2009

A silly C# trick from the trenches

UPDATE: as Joe rightly points out in the comments (thanks Joe) when you try to pass a...

Author: Alex D James Date: 07/24/2009

I never knew: C# method overloads can return different types

I came to C# from Java, which I’m pretty sure doesn’t (or maybe didn't) allow this, so I was super...

Author: Alex D James Date: 07/22/2009

Tip 27 – How to Implement BeforeSave Validation

It is common to want to validate that your entities are ‘valid’ before you save them to the...

Author: Alex D James Date: 07/20/2009

New EF blogger – Craig Lee

Short one this time. Craig Lee, a colleague of mine who works on the tools team, has just started...

Author: Alex D James Date: 06/19/2009

Tip 26 – How to avoid database queries using Stub Entities

What are Stub Entities? A stub entity is a partially populated entity that stands in for the real...

Author: Alex D James Date: 06/19/2009

Wrapping Providers

For well over a year now I've been talking about how it is possible with EF to write a provider that...

Author: Alex D James Date: 06/12/2009

Tip 25 – How to Get Entities by key the easy way

Sometimes rather than writing this: var customer = ctx.Customers.First(c => c.ID == 5); You would...

Author: Alex D James Date: 06/11/2009

Tip 24 – How to get the ObjectContext from an Entity

Customers often ask how to get from an Entity back to the ObjectContext . Now generally we don’t...

Author: Alex D James Date: 06/08/2009

Tip 23 – How to fake Enums in EF 4

As of right now Enums are not in EF4. Now we will be listening to your feedback about Beta1, and...

Author: Alex D James Date: 06/05/2009

Ordering of Commands – What do you think?

Some of our customers write code like this: ctx.AddToCustomers(customer);...

Author: Alex D James Date: 06/05/2009

Tip 22 - How to make Include really Include

This is 22nd post in my ongoing series of Entity Framework Tips.If you want to do eager loading with...

Author: Alex D James Date: 06/02/2009

An enumeration of one?

Having something enumerable is the gateway to all LINQ’s loveliness. But sometimes you have just one...

Author: Alex D James Date: 05/28/2009

Learn about EF Pluralization Services courtesy of Dan Rigsby

Not long ago I wrote a ‘sneak peek’ for our new Pluralization features on the ADO.NET team blog....

Author: Alex D James Date: 05/22/2009

Tip 21 – How to use the Single() operator – EF 4.0 only

This is 21st post in my ongoing series of Entity Framework Tips, and the first that is specific to...

Author: Alex D James Date: 05/21/2009

Tip 20 – How to deal with Fixed Length Keys

This is 20th post in my ongoing series of Entity Framework Tips. Fixed Length Field Padding: If you...

Author: Alex D James Date: 05/20/2009

Tip 19 – How to use Optimistic Concurrency with the Entity Framework

This is the 19th post in my ongoing series of Entity Framework Tips. Background: If you have a table...

Author: Alex D James Date: 05/19/2009

Tip 18 – How to decide on a lifetime for your ObjectContext

One of the most common questions we get is how long should an ObjectContext should live. Options...

Author: Alex D James Date: 05/07/2009

Tip 17 – How to do one step updates with AttachAsModified(..)

Background: In Tip 13 - How to Attach the easy way I showed you how to ‘establish’ the EntitySet for...

Author: Alex D James Date: 05/02/2009

Video on Entity Framework’s Model First in .NET 4.0

How did I miss this? Jonathan Carter (aka LostInTangent) has done a Channel 9 video on our upcoming...

Author: Alex D James Date: 05/01/2009

Interesting reads

Over the weekend in between run throughs that I did prepping for a webcast, I did some catch-up blog...

Author: Alex D James Date: 04/28/2009

Corrected Tip 15 - How to avoid loading unnecessary properties

I've made a few important corrections to Tip 15. I've corrected the bit that said the UPDATE SQL...

Author: Alex D James Date: 04/27/2009

Tip 15 - How to avoid loading unnecessary Properties

UPDATE: Made a couple of important corrections re-which Original Values are required. Problem:...

Author: Alex D James Date: 04/24/2009

An analogy: Good UIs and Fluent APIs

Background A while back I was writing a web app to try the Entity Framework and MVC together. I knew...

Author: Alex D James Date: 04/16/2009

Tip 12 - How to choose an Inheritance Strategy

What strategies does the Entity Framework support? The Entity Framework supports 3 primary...

Author: Alex D James Date: 04/14/2009

Tip 11 – How to avoid Relationship Span

Background and Motivation: In my last post on EF Jargon I introduced the concept of Relationship...

Author: Alex D James Date: 04/06/2009

Tip 9 – How to delete an object without retrieving it

Problem The most common way to delete an Entity in the Entity Framework is to pull the Entity you...

Author: Alex D James Date: 03/27/2009

Tip 8 - How to write 'WHERE IN' style queries using LINQ to Entities

Imagine if you have a table of People and you want to retrieve only those whose the Firstname is in...

Author: Alex D James Date: 03/25/2009

Tips and Tricks

Hopefully if you're reading this you've noticed that I've started a series of Tips recently. The...

Author: Alex D James Date: 03/25/2009

Tip 7 - How to fake Foreign Key Properties in .NET 3.5 SP1

Background If you've been reading the EF Design Blog you will have seen that we recently announced...

Author: Alex D James Date: 03/24/2009

Self-Tracking Entities

Some of the feedback we got on the EF design blog about our early N-Tier plans, highlighted that...

Author: Alex D James Date: 03/23/2009

Tip 6 - How and when to use eager loading

When should you use eager loading? Usually in your application you know what you are going to "do"...

Author: Alex D James Date: 03/23/2009

Tip 5 - How to restrict the types returned from an EF Query.

Imagine you have a model that looks like this: How do you query for just Cars? This is where...

Author: Alex D James Date: 03/20/2009

Tip 4 - Conceptual Schema Definition Language Rules

The first version of the Entity Framework was released a while back ago now with .NET 3.5 SP1. One...

Author: Alex D James Date: 03/19/2009

Tip 3 - How to get started with T4

So if you've been reading the Entity Framework Design Blog you will have heard us talk about T4. It...

Author: Alex D James Date: 03/02/2009

Alt.NET Seattle

I went to Alt.NET Seattle on the weekend. Being from the Entity Framework team, I was a little...

Author: Alex D James Date: 03/02/2009

Tip 2 - Entity Framework Books

Question: Where do I find in depth books on the Entity Framework? Answer: One of the benefits of...

Author: Alex D James Date: 02/26/2009

Tip 1 - How to sort Relationships in Entity Framework

Question: One of the questions you often see in the Entity Framework Forums is around sorting...

Author: Alex D James Date: 02/25/2009

Side effects of first class Associations

You've probably all heard someone say that Entity Data Model (EDM) and more specifically the Entity...

Author: Alex D James Date: 02/19/2009

<Previous Next>