Monthly Archives: June 2008

Entity Framework: How to use Entity Splitting with different PK?

Imagine you want to create an application which manages product stocks using Northwind but which doesn’t create products. For this, we want two Entitysets: Product and Supplier with Supplier on read only. We also want a read only product CategoryName … Continue reading

Posted in 7671, 7674, 7675 | 3 Comments

Clarifying "AsEnumerable: not only to use unsupported methods"

As you have probably seen with Roger comment and his blog post about this, my post “AsEnumerable: not only to use unsupported methods” wasn’t very clear. So I will try to clarify it. In my old post Entity Framework Include … Continue reading

Posted in 7671, 7674 | Leave a comment

With SP1, VS 2008 manage anonymous types with C# Debugger

Sreekar Choudhary wrote a post about a new (VS 2008 SP1) C# debugging management. We can now use an anonymous type to do a cast or instanciate anonymous types in the C# debugger.

Posted in 7671, 7672 | Leave a comment

AsEnumerable: not only to use unsupported methods

AsEnumerable extension method allow us to use an IEnumerable<T> instead of an IQueryable<T>. This allows, for example, to call an unsupported method by LINQ To Entities in a LINQ To Entities request. However, this method can have another interest. Imagine that you want to get Northwind orders if date … Continue reading

Posted in 7671, 7674 | 3 Comments

How to bind Radio Buttons on an enum property?

Imagine this case: public class MyBusinessClass {     public MyEnum Value { get; set; } } public enum MyEnum {     One,     Two,     Three,     Four,     Five } I want to generate dynamically my radio buttons and … Continue reading

Posted in 7671, 7679 | 2 Comments

Managed Extensibility Framework CTP1

Krzysztof Cwalina announced first public Managed Extensibility Framework (MEF) CTP.What’s this? MEF is a framework which simplify add-in/plug-in in your applications. Enjoy

Posted in 7671, 7871 | 1 Comment

Entity Framework Include with Func next

I defined an Include with Func. Cool. But what about Include(“Products.Order_Details”)? Indeed my Include can only take one relationship level. So I change my code like this: public static class ObjectQueryExtension {     public static ObjectQuery<T> Include<T>(this ObjectQuery<T> mainQuery, Expression<Func<T, object>> subSelector) … Continue reading

Posted in 7671, 7674 | 22 Comments

Entity Framework Include with Func

Update: I made a new version here. In Northwind DB, if you want to load categories with products, you will use Include method: context.Categories.Include(“Products”) But what I really find bad is the fact that Products is a string. When we use … Continue reading

Posted in 7671, 7674 | 21 Comments

EF FAQ new update

Daniel Simmons updated EF FAQ. What are the changes? (from Daniel ‘s post). Updated: 1.2 Where else should I go to learn more about the EF? New: 7.7 Why does deleting an entity from my context not delete all related entities … Continue reading

Posted in 7671, 7674, 7675 | Leave a comment

EF relationships and the difficulties to add entity

I had an interesting question. This code: using (var context = new NorthwindEntities()) {     var c = context.Categories.First(categ => categ.CategoryID == 1);     var p = new Products { ProductName = “test”, Categories = c };     Console.WriteLine(c.Products.Count); } … Continue reading

Posted in 7671, 7674 | 8 Comments