Ownera
Ownera
CC#
Created by Ownera on 10/10/2024 in #help
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 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; }

}
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.
27 replies