Find out type of a class typed to compare it with object

0

How do I find out the type of a typed class to compare it with an object?

This is my code:

public static Salon<T> operator +(Salon<T> salon, T per)
{
    if (salon.Equals(per))
        throw new NoAgregaException("El elemento es del tipo " + per.GetType() + " y se esperaba  " + salon.GetType());

    if (salon._elementos.Count < salon._capacidad)
        throw new NoAgregaException("asdfadsf");
    else 
        salon._elementos.Add(per);

    return salon;
}
    
asked by Federico Tomadin 16.07.2017 в 20:19
source

0 answers