jeudi 24 août 2017

How can I sent the type to function

I have this function

  public IList<TEntity> GetData<TEntity>() where TEntity : class
    {
        return _DbContext.Set<TEntity>().ToList();
    }

and I call this function like this

GetData<View_Export_Books>()

So now I have to load the class View_Export_Books dynamically from a string. Is this possible?

Thanks for any help.





Aucun commentaire:

Enregistrer un commentaire