Posts

Showing posts from October 4, 2009

Tips while working with Entity Framework

Image
I started to work with ADO.NET Entity Framework last week evaluating it from my future projects. While working on it I came up with couple of hurdles but all these were short comings in the version 1.0. It’s expected that it is all going to be fixed by 4.0 (.NET 4.0 Version release). Some of the learning’s  I wanted to illustrate are as follows   1. Use of Stored Procedures                 When we use Stored Procedures and want to map this to any entity. Assume that we have created a SP for inserting data into a table. After we do a function import of the SP. When we do a function mapping of SP there are three options as shown below       But we may have only the Insert Stored Procedure and there is no need for Update and Delete. In this case we cannot use this function mapping because as per Ver 1.0, all the three is a must. The workaround for this is to create a Connection and Call the SP using the EntityConnection and EntityCommand  . To build the Connection Strin