How do I create a nullable (?) class in C#? Like:
public class Hello1 {
public int Property1 { get; set; }
}
public class Hello2 {
Public Hello1? Property2 { get; set; } //Hello1 should work when it has "?"
}
I want to make Hello1 class to be able to take the form Hello1? if needed.
You don’t need to create a nullable type for reference types. They’re already nullable. You only need to do this for Value types like int, bool, decimal, etc…