I have heard people state that Code Generators and T4 templates should not be used. The logic behind that is that if you are generating code with a generator then there is a bet
quote: I have not really found effective ways to build templates that can say for instance instantiate themselves. In otherwords I can never do :
return new T();
public abstract class MehBase
where TSelf : MehBase, new()
{
public static TSelf CreateOne()
{
return new TSelf();
}
}
public class Meh : MehBase, TParam1, TParam2>
{
public void Proof()
{
Meh instanceOfSelf1 = Meh.CreateOne();
Meh instanceOfSelf2 = Meh.CreateOne();
}
}