C#C
C#15mo ago
Ownera

Just learned generics...

I just learned generics and have a problem that i tried googling but still couldnt solve.

I have a person class

C#
internal class Person<T> where T : Person<T>
    {
        public T Name { get; set; }
        public T Pass { get; set; }

        

    }


C#
internal class User : Person // this is the error.At person, CS0305
    {

        public string Nameu { get; set; }

        public string Passu { get; set; }

    }


And a user class that i want to inherit the Person class.
Was this page helpful?