Friday, 9 August 2013

T4 template for Unit of Work implementing DataContext

T4 template for Unit of Work implementing DataContext

I have created Repository and IRepository.
I want to create UnitOfwork from T4, so that it will generate.
Basically I have multiple DataContext classes as below, so I want to get
all classes implementing DataContext and add them into a "Unit Of Work".
How can I do this from a T4 template, I am unable to use reflection in T4
public interface IUnitOfWork : IDisposable
{
IRepository<User> UsersRepository {get;}
IRepository<Role> RolesRepository {get;}
IRepository<AClass> AClassRepository {get;set;}
IRepository<BClass> BClassRepository {get;set;}
}

No comments:

Post a Comment