Gil Fink on .Net

Fink about IT

News

Microsoft MVP

MCPD Enterprise Applications Developer

Gil Fink

My Linkedin profile

Locations of visitors to this page

Creative Commons License

Blog Roll

Hebrew MSDN Articles

Index Pages

My OSS Projects

Browse by Tags

All Tags » Entity Framework (RSS)
CompiledQuery in Entity Framework
CompiledQuery in Entity Framework There are times when we want to make optimizations on some piece of code. If we want to reduce the cost of executing a query in Entity Framework we can use a CompiledQuery to the rescue. Yesterday I used added a compiled query to a code base which was executing multiple times. This reduced the execution time of the repeating queries. In the post I’ll explain what are CompiledQueries and how to use them. CompiledQuery CompiledQueries are a delegate which store a compiled...
Entity Framework Evolution in .NET 4 at DevAcademy4
Entity Framework Evolution in .NET 4 at DevAcademy4 As I wrote yesterday DevAcademy4 is coming next month. My part in the conference will be a breakout session on EF4 . In the session we will explore the major changes that EF4 offers and how they can contribute to develop better data access layers. There are other great sessions in the conference which you can review from here . See you there!
Developer Academy 4 is Coming
Developer Academy 4 is Coming The biggest Israeli .Net developers conference is coming. Today the conference site of Developer Academy 4 was launched and you can sign in to the conference from here . You can also register as a fan in Facebook from here for online updates. This year the conference will be focusing on Visual Studio 2010 , Windows Azure and Silverlight . There are going to be many breakout sessions and also mini sessions which will include only demos. The conference will occur in March...
Entity Framework Context Lifetime Best Practices
Entity Framework Context Lifetime Best Practices In this post I’m going to write about one of the major decisions that you need to take when you use ORM tools like Entity Framework . This decision is the context lifetime . The Problem Context lifetime is a very crucial decision to make when we use ORM s. Since the context is acting as an entity cache (it holds references to all the loaded entities for change tracking and lazy loading purpose), it may grow very fast in memory consumption. Also this...
Using Unit of Work Pattern with Entity Framework
Using Unit of Work Pattern with Entity Framework In a previous post I explained how to create a simple repository on top of Entity Framework . In this post I’ll explain the Unit of Work pattern and how we can use it with our data access layer. What is Unit of Work Pattern? In his famous and developer must read book “ Patterns of Enterprise Application Architecture ”, Martin Fowler defines the Unit of Work as “Maintains a list of objects affected by a business transaction and coordinates the writing...
Entity Framework at Sela Open House
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...
Table Per Concrete Type Inheritance in Entity Framework
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 Type Definition The TPC inheritance occurs when we have two tables with overlapping fields in the database. Such a thing can occur in situations that we create...
Table Per Hierarchy Inheritance in Entity Framework
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. The TPH inheritance depends on a conditional mapping which is defined by a condition such as a discriminator database field. The condition...
Table Per Type Inheritance in Entity Framework
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...
Entity Framework Inheritance Types
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 supported in other ORM s as well. Why to Use Inheritance? One of the ORM s main purposes is to enable us the domain developers to create a conceptual model...
Using Repository Pattern with Entity Framework
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 show how you can use the Repository Pattern in order to make an abstraction layer on top of Entity Framework . The Repository Interface When...
Defining Custom Functions in Entity Framework
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 imported functions. In that way we could define functions in the...
Sessions in Sela SDP
Sessions in Sela SDP Yesterday I finished my part in the Sela SDP with two sessions. The first session I delivered was EF4 evolution in .NET 4 . In that session I showed the new features of EF4 which make it a mature technology. I want to thank the audience that attended the session. Since I finished the lecture early, I also had an improvised session about how to create inheritance with EF . In the afternoon I took a part of the Sela ’s 6 MVP ’s session which was an experts panel about technologies...
ORM Day at Sela SDP
ORM Day at Sela SDP Today I took a part of an ORM tutorial day at Sela SDP conference . The day included the following sessions: ORM and EF by Ido Flatow EF and NHibernate Head to Head by Erez Harari and Bernie Almosni EF Deep Dive by myself Real World Data Patterns with ORM by Erez Harari and Bernie Almosni Experts panel with all the gang of four ( Ido , Bernie , Erez and myself) and joined us Oren Eini In my session I talked about the use of Stored Procedures in EF model, Inheritance mapping and...
T4 Templates in Entity Framework 4
T4 Templates in Entity Framework 4 T4 templates or Text Template Transformation Toolkit is a mean of creating a code generation artifacts which can save a lot of time. This technology is a part of Visual Studio since 2005 but was one of those technologies that were kept in secret by Microsoft . Almost all the code generation stuff that is being used in Visual Studio in technologies such as MVC, Entity Framework, LINQ to SQL and many other use those templates as backbone to generate code. In this...
More Posts Next page »