Sorry, its a .Net Maui app. I just want to know what is the best practice for checking the values of properties on a class.
There's no magic. Check the value using standard C# syntax and operators. How you go about validating a property depends on how the code is intended to function also known as a "use case" which you still have not explained clearly.
static void Main()
Pizza p = new Pizza();
string size = p.pizzaSize ?? "Size is empty";
The code above displays "Size is empty" in the console. I'm using the C# coalesce operator. There are other method like an "if" or the ternary conditional operator. The approach you decide on depends on the situation.