Welcome to MSDN Blogs Sign in | Join | Help

May 2009 - Posts

An enumeration of one?
Having something enumerable is the gateway to all LINQ’s loveliness. But sometimes you have just one object. So how do you make that enumerable? var people = new Person[] {person}; Not exactly hard huh? In fact you can simplify this even more, you can Read More...
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. There is a more indepth post coming soon… But it seems the community is starting to do our education for us, and beating us (or should I say me) to the punch! Read More...
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 EF 4.0. Entity Framework 4.0 Beta 1 As you’ve probably heard VS 2010 Beta 1 is now available to subscribers which means some of you can get your hands Read More...
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 have an fixed length column in the database, for example something like NCHAR(10) when you do an insert, padding happens automatically. So for example Read More...
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 with a timestamp column, and you reverse engineer an Entity from that table, you will end up with a Binary property in your entity (in my example called Read More...
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 often cited include one per: Function Form Thread Application Plenty of people are asking these types of questions, case in point here is a question on Stackflow Read More...
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 a particular CLR Type so you could Attach it. But in all the tips so far the same basic pattern is used: Attach the original version of the Entity Modify Read More...
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 Model First experience. Model first was announced a while back here . Read More...
Tip 16 – How to mimic .NET 4.0’s ObjectSet<T> today
Background: In order to be an EF power user today you really need to be familiar with EntitySets . For example you need to understand EntitySets in order to use AttachTo(…) or create EntityKeys . In most cases there is only one possible EntitySet for Read More...
Page view tracker