Browse by Tags
All Tags »
T4 Templates (
RSS)
How to Separate Self-Tracking Entities to Their Own Class Library Last week I had a session in Teched Israel 2010 which included approaches for building N-Tier applications on top of Entity Framework 4 as the data access technology. During the session I showed an example of how to use the new Self-Tracking Entities ( STE ) feature. In this post I‘m going to show how easy it is to put the STE in a different class library as a jump start for using this T4 Template in N-Tier scenarios. What is Self...
Repository and Unit of Work T4 Template for Entity Framework Two weeks ago I wrote the Revisiting the Repository and Unit of Work Patterns with Entity Framework post. One thing that I thought would be nice was to have an automatic code generation that will help me to build these patterns without sweating. So I sat down and created a T4 Template to auto generate the same patterns that I showed in the post. The Code One thing to understand is that the provided T4 Template isn’t bullet proof and errors...
Reading a Xml File in T4 Templates After I wrote the post about the use of T4 templates in EF4 , I played with them for a while (not in EF but generally with T4 templates ). In an old project that I’ve created almost 3 years ago which automated the use of lookup tables I had an enum. That enum was meant to be the connection between an Xml node names and was heavily used in the application. For each Xml node I needed to add an entry in the enum. So I thought what the hell lets see if I could have...
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...