how do i print instead of nothing – “unknown”?
You can use the null-coalescing operator
public string DogsOverall()
{
return $"Name {Name ?? "unknown"}, sex{Sex ?? "unknown"}, fathers name is {Father ?? "unknown"}, mothers name is {Mother ?? "unknown"}";
}
solved C# how to check if var contains constructor Params