T4 to generate DTO' and Nullable Datatypes
I'm trying to generate DTO's with T4. I found a great blog post that does exactly what i'm looking for but it explodes on Nullable data types.
http://weblogs.asp.net/cibrax/archive/2009/03/11/code-generation-with-t4-an-entities-to-dto-example.aspx?CommentPosted=true#commentmessage
This generates code with Nullable types like below
[DataMember(Name="term开发者_如何学JAVAinationCFDate")]
public System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] TerminationCFDate
{
get; set;
}
I am looking for something like below
[DataMember(Name="terminationCFDate")]
public Nullable<DateTime> TerminationCFDate
{
get; set;
}
I am very new to T4. Any suggestions?
Modified the template. It was using reflections.
精彩评论