March 2010 - Posts

2
Comments

Modifying Self Tracking Entity on the server by zhirani

Suppose you are working with a console application on the server and you have created an entity data model with applicant entity as shown below. You want to instantiate an existing applicant entity, modify a specific property and send only the changed...
2
Comments

Loading recursive queries by zhirani

Entity framework supports self referencing entity where an entity has a a reference to itself. A common example of that would be a category with subcategories. In the database you would typically see a category table with a ParentCategoryId column which...
6
Comments

Using Self Tracking Entity to retrieve and update by zhirani

In this tutorial I will explain how to use Self Tracking Entity to retrieve entities from a WCF service, modify the object graph on the client side and then send those changes back to the server in a clean way. Suppose we have Resource and Roles with...
0
Comments

Returning Maximum value from 1-to-many association by zhirani

Today I was working with two entities and i wanted to return the maximum value in the many table for each record in the parent table. There are several approaches to returning the desired data but since my tables had lots of records i wanted to explore...
0
Comments

Registering with AssociationChanged event on POCO with change tracking proxy by zhirani

Entity Framework 4.0 allows you to use POCO objects for your entities defined on the model. Suppose one of the POCO entity has a collection property and you want to be notified when a new entity is added or removed from the collection. How do we get notified...
3
Comments

Placing Model in separate Assembly by zhirani

Today, I was cruising the forum and i ran across an interesting post where the poster wanted to place the model and ObjectContext in different assemblies. Imagine you have a customer table and you created the Entity Data Model with Customer entity. You...
More Posts