1
I have the following situation:
public List<TEntidade> MeuMetodo<TEntidade>()
{
//My Code Here
}
Is there any way I can catch this guy from Tentity? The ultimate goal is to use this Type to create a switch...
1
I have the following situation:
public List<TEntidade> MeuMetodo<TEntidade>()
{
//My Code Here
}
Is there any way I can catch this guy from Tentity? The ultimate goal is to use this Type to create a switch...
1
Use the typeof
. Then, just get the string
with the name, and apply on the switch, thus:
Type tipoEntidade = typeof(TEntidade);
string tipo = tipoEntidade.FullName;
switch (tipo)
{
...
}
0
You can use Typeof() thus:
Type seuTipo = typeof(TEntidade);
Browser other questions tagged c# .net generic
You are not signed in. Login or sign up in order to post.