Gil Fink's Blog

January 28, 2010

Entity Framework at Sela Open House
Yesterday, even though I’m currently sick (I have the flu), I delivered a session about Entity Framework at Sela Open House event. In the session I introduced Entity Framework, talked about the EDM, explained how to query and manipulate data and in the end talked about what is coming in EF4. I want to thank all the attendees who came to hear the session. As I promised, I uploaded the session slide deck and demos to my SkyDrive and you can download them from here.
Enjoy!

January 27, 2010

Don’t Repeat Yourself Today while I was doing code review I found myself writing a new generic function instead of one piece of code that was repeating itself in the developer’s code. When you write code sometimes you have to duplicate some piece of code. ...

January 25, 2010

Table Per Concrete Type Inheritance in Entity Framework The last inheritance mapping that I’m going to write about is the Table Per Concrete Type inheritance (TPC). This inheritance type is very rare but you should be aware of how to create it when it is needed. You can read about TPT and TPH from here and from here. Table Per Concrete...

January 24, 2010

Table Per Hierarchy Inheritance in Entity Framework In the second inheritance mappings tutorials I’m going to write about the Table Per Hierarchy (TPH) inheritance mapping. If you want to read about the first mapping I showed go to the Table Per Type post from here. Table Per Hierarchy Definition In TPH the inheritance tree is create through one table only. ...

January 22, 2010

Table Per Type Inheritance in Entity Framework
The first inheritance mapping I’m going to show is called Table Per Type or TPT. Before I start with the example lets define what is TPT.
Table Per Type Definition
TPT is an inheritance described in the database with separate tables. Every table provides additional details that describe a new type based on another table which is that table’s parent. In the following database ERD the OnlineCourse table is a concrete type of Course: As you can see the CourseID of both Course and OnlineCourse table are the same identity.
TPT Example
The following steps will...

January 20, 2010

Entity Framework Inheritance Types In Sela SDP conference I was asked if Entity Framework supports inheritance mapping. The answer I gave was a small 25 minutes improvised session which I gave after the EF4 session I had. In the following three posts I’m going to explain the main three inheritance ways that you can use with EF. These ways are...

Using Repository Pattern with Entity Framework One of the tools for reaching for persistence ignorance is to build a facade between the data access layer and your business logic. Such facade will prevent the knowledge of how the data access is working and with which technology. That abstraction can be achieved by using the Repository Pattern. In the post I’ll...

January 1, 2010

Defining Custom Functions in Entity Framework During the SDP conference I have been asked about the use of functions inside the EDM. This post will try to answer one such question of how to define a custom function in EF. Custom Functions in Entity Framework One of the capabilities of EF since EF1 was the creation of custom functions inside the SSDL part of the model. After their creation we could consume them like other...