I need to build a class in this form
namespace BestCompanyEver
{
public class PersonInfo
{
public string Name{get;set;}
public int Age{get;set;}
}
}
From a table Person that has columns Name and Age.
Are there any ready to use solutions for this?
I know I can implement this with T4 or Codesmith, but there should be somebody who already did it.
I found some nice T4 template I could use. Its from a project on codeplex.
LINQ to SQL templates for T4
The template is hard to read an it took me a while to simplify it.
Before you can use it you have to download an include (CSharpDataClasses.tt ) from the project.
Here is my template ():