How would I wire up StructureMap with the following:
public Interface IRepository<T, TIdentity>{}
public abstract class Repository<T, TIdentity> : IRepository<T, TIdentity>, other interfaces
I have many concrete implementations of Repository and need StructureMap to wire them up automatically.
public class JournalRepository : Repository<Journal,int>{}
public class UsersRepository : Repository<Users,int>{}
public class AccountGroupsRepository : Repository<Accounts,string>{}
etc.
I've tried:
x.ForRequestedType(typeof(IRepository<,>))
.TheDefaultIsConcreteType(typeof(Repository<,>));
but I just get StructureMap Exception Code: 25 (with no explanation).
Is this at all possible?
Many thanks Jeremy