Tag: Entity framework
-
Optimizing EF4 and EDMGen2
Just reading (from Adrian Florea links ) how the EF4 could be optimized : http://www.codeproject.com/KB/database/PerfEntityFramework.aspx First modification is to “Pre-generated Your View”. For this you must have .ssdl,.csdl,and .msl files – so you change the “Metadata Artifact Processing property to: Copy to Output Directory.”. Then you process the .ssdl,.csdl,and .msl with edmgen in order to…
-
TT files – generate enum from database
Many times you will program against a table that contains something like an enum,like Status( open=1,close=2,sent=3,approved=4 ) . It is peculiar to wrote those status as text in the other tables – and you do not like also to have update their codes in the C# (VB.NET) code source each time you will add another…
-
EF,automatic history of table and T4 files (TT files)
Usually the data of the tables should be tracking for who modified it. Think about inserting/updating/deleting an employee : you must know who did those actions and when. So you create another table,identically as structure,and you add another 3 fields,such as [ModifiedDate](when),[ModifiedBy](who),[ModifiedType] (what : insert,update,delete). There are several methods to do it : from database…
-
Entity Framework profiler
Many times I’ve had problem with the following error when inserting objects with dates with Entity Framework : System.Data.UpdateException An error occurred while updating the entries. See the inner exception for details.SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. Ok,it’s my faute – but to remember each one date is too…