The hidden assumption of EF 4 self-tracking entity

Wednesday, October 20, 2010

The hidden assumption of EF 4 self-tracking entity recently I was diving into the Entity Framework self-tracking entity T4 and its generated code. doing so I was finding some interesting assumptions made about the entity behaviors. this post will illuminate some of those assumptions.   Background EF self tracking entity is one of the major enhancement of EF 4.0, it is a disconnected model (similar to the old DataSet) which enable tracking the entity state (Added, Modified, Deleted and Unchanged) while the...
no comments

T4 tip (debug)

Sunday, August 15, 2010

T4 tip (debug) while I was writing the post on T4 debugging (here), I had show how to use System.Diagnostics.Debugger.Break() in order of getting the debugger stop.   actually there is 2 problem with this pattern: the break point remain active while no debugger is attached. it cause VS to crash when ever saving the t4, when the debugger doesn't attached. Solution we can overcome those issues by changing the pattern to match the following: Code Snippet ...
tags:
no comments

T 4 beginners – part 4

Saturday, May 22, 2010

T 4 beginners – part 4 this is the 4rd post on this series. in this post we will focus on T4 Class feature control blocks. you can download the code for this post here. the series TOC is available here.   What is class feature control block? class feature control block is one of the T4 extension mechanism that enable reuse of T4 sections. using class feature control block you can defines helper properties or methods, that can be used from different T4...
tags:
no comments

T 4 beginners – part 3

Friday, May 21, 2010

T 4 beginners – part 3 this is the 3rd post on this series. in this post we will focus on basics T4 Control blocks. you can download the code sample from here. the series TOC is available here.   T4 Control blocks is where dynamic text is added into the template output, this is the heart of T4 concept (C# is the default language but you can change it to VB).   Standard control blocks A standard control block is a section of...
tags:
no comments

T 4 beginners – part 2

Wednesday, May 19, 2010

T 4 beginners – part 2 this is the second post on this series. in this post we will focus on basics T4 Directives. you can use the code sample of the previous post here. the series TOC is available here.   Directive syntax: any of the directives is using the following syntax: <#@ DirectiveName #> it start with <#@ follow with the directive name, includes zero or more name value parameters and end with #> All parameter values...
tags:
no comments

T 4 beginners – TOC

T 4 beginners – TOC The current available posts on the T 4 beginner series (T4 template) are: Introduction Directives Control blocks Class feature control blocks Debug
tags:
no comments

T 4 beginners – part 1

Tuesday, May 18, 2010

T 4 beginners – part 1 this is the first post of a series that will focus on T4 template. this post discuss the T4 in general while the following pose will focus on the T4 practice. the code for this post can be found here. the series TOC is available here.   What is T4 template? T4 is sanding for Text Template Transformation Toolkit. T4 is all about automating code or content generation. the usual extension for T4 files is the *.tt   When...
tags:
no comments