Monthly Archives: August 2008

EF and WPF

I had a question today which allow me to do my first WPF poject. [:)] The guy told me that he has a master detail scenario with two windows: one to edit masters and one to edit details. In details, … Continue reading

Posted in 7671, 7674, 7675, 8708 | Leave a comment

TPH Is Not NULL mapped on a relationship

As I wrote in a previous post, with EF V1, there is a limitation on the mapping of columns with the condition Is Not Null: the property mapped to the column must be scalar and can’t be (indirectly) a navigation property. So … Continue reading

Posted in 7671, 7674, 7675 | Leave a comment

LINQ To Entities: stranger and stranger

I was looking for this LINQ To Entities “bug ?”. I watched the SQL generated queries and in fact it’s even stranger than what I thought at first. For the first LINQ To Entities query: from c in context.Customers.Include(“Orders”) where … Continue reading

Posted in 7671, 7674 | Leave a comment

TPH limitation which should disappear with v2

When you have a condition like myColumn Is Not Null, you must map the column on a non nullable property BUT with EF v1, you can’t map the column on a relationship (even if the cardinality is one). For example, … Continue reading

Posted in 7671, 7674, 7675 | 1 Comment

LINQ To Entities: Strange, very strange

From Northwind, if I run this query: from c in context.Customers.Include(“Orders”) where c.CompanyName.StartsWith(“An”) let od = (from o in c.Orders           select o.OrderDate).OrderByDescending(o => o).FirstOrDefault() orderby od descending select c; I have the customers of these company: Ana … Continue reading

Posted in 7671, 7674 | Leave a comment

TPH is more than a selection!

For some persons, the TPH is just a selection but in fact it’s actually more than this. Imagine the following table: Id (PK) Type int NULL Imagine than we want to do TPH on Type column. I had some questions like … Continue reading

Posted in 7671, 7674, 7675 | Leave a comment

How to have a property on ObjectContext which returns the derived entities? v2

With Danny advices, I improve my custom code generator to do this in only one generation. public class SampleEdmxCodeGenerator : BaseCodeGeneratorWithSite {     private EntityContainer _objectContext;     private Dictionary<string, string> _entitySetNames;     private Dictionary<string, List<string>> _typesHierarchyToAddInObjectContext;       public Dictionary<string, string> … Continue reading

Posted in 7671, 7674, 7675, 8606 | Leave a comment

How to debug a code generator used by VS?

In my case, I wanted to debug my edmx CodeGen but you can do it for a lot of other cases. So how to debug your CodeGen? I think there is probably a better way but this is what I … Continue reading

Posted in 7671, 7675, 8606 | Leave a comment

How to have a property on ObjectContext which returns the derived entities?

With EF v1, we have an ObjectContext which has one property per EntitySet. The “problem” is that if you have an entity type Person and an entity type Employee which inherits Person, you will have only one property Persons because there … Continue reading

Posted in 7671, 7674, 7675, 8606 | 3 Comments

Debug with the .Net Framework code

With VS2008, we were able to Debug with the .Net Framework code. But there weren’t all the dll. With the SP1, yes! [:D] Moreover, the activation of this is really easier than before. You don’t have anything to do! You just need … Continue reading

Posted in 7671, 8606 | 2 Comments