I have the following class and I want to call the Get
method on this class. The problem is that I dont't have the type T
. I have the string name of type T
, that's all.
What I want is some thing like: This class is also registered with structure map but I dont how I can use it in structuremap
string name ="FooClass";
//Get IBaseCodeService<FooClass> then call Get method
public class BaseCodeService<T> : IBaseCodeService<T> where T : BaseCode
{
readonly IAttributeUow uow;
public BaseCodeService(IAttributeUow uow)
{
this.uow = uow;
}
public async Task<IEnumerable<T>> Get()
{
using (uow)
{
var repo = uow.GetCoreRepository<T>();
return await repo.GetAll().ToListAsync();
}
}
}