Monthly Archives: July 2008

Why does my French blog have more posts than my English one?

Some of you remark that I write some posts in French that I don’t translate in English and ask me why. In fact it’s very simple. When I actually write a post, I systematicly translate it but when I just mention a … Continue reading

Posted in Uncategorized | Leave a comment

Daniel Simmons on DnrTV, part 2

Two weeks ago, drnTV proposed an Entity Framework introduction by Daniel Simmons. Today, there is the part 2: EF ans ASP. Net, Data Serivces Framework (aka Astoria) and EF and a WCF service. This second part also introduces a new web project template: … Continue reading

Posted in 7671, 7674 | 1 Comment

EntityReference change key

From Northwind, I want to add the following method to Product class: public void SetCategory(int categoryID) {     // ??? } The problem is that from product class, I have no reference to the ObjectContext (which can be null if … Continue reading

Posted in 7671, 7674 | 8 Comments

EF and the crazy tester

I try to do some stupid EF tests. From Northwind Product table, I did following inheritance: <EntityType Name=“Product“>     <Key>         <PropertyRef Name=“ProductID“ />     </Key>     <Property Name=“ProductID“ Type=“Int32“ Nullable=“false“ />     <Property Name=“ProductName“ Type=“String“ Nullable=“false“ MaxLength=“40“ Unicode=“true“ … Continue reading

Posted in 7671, 7674, 7675 | Leave a comment

Entity Framework: how to clone an entity?

In my last post, I wrote that the classic detachment/attachment pattern includes the clone of the entity. But some of you didn’t know how to clone an entity. I see two choices: you can use reflection (with optimization ability) as I did … Continue reading

Posted in 7671, 7674 | Leave a comment

Optimistic update

Here is the classic pattern of entities detachment / attachment: We get the entity.We send the entity to the client which clone it.To update entity, the client send to the server the initial entity and the modified one.Then, the server instanciates … Continue reading

Posted in 7671, 7674 | Leave a comment

One table -> two entity types, relationship management

With my two last posts (ssdl view and TPT and ssdl view and TPH), I show you how to have two entity types mapped on one single table without discriminator column. Now, next step. In my table Employees, I have a … Continue reading

Posted in 7671, 7674, 7675 | Leave a comment

ssdl view and TPT

I want to do the same than my last post with TPT. I add this in ssdl: <EntitySet Name=“Managers“ EntityType=“TestModel1.Store.Managers“>     <DefiningQuery>         SELECT DISTINCT EmployeeManager         FROM EmployeesWithManager     </DefiningQuery> </EntitySet> <EntityType Name=“Managers“>     <Key>         <PropertyRef Name=“EmployeeManager“ … Continue reading

Posted in 7671, 7674, 7675 | Leave a comment

ssdl view and TPH

This post uses the same idea than my last one: “Entity Framework: How to use Entity Splitting with different PK?”. We have a table Employee with 3 columns: EmployeeId (PK), EmployeeName and EmployeeManager (FK to EmployeeId). In my EDM, I … Continue reading

Posted in 7671, 7674, 7675 | 2 Comments