Validate object properties

Ronald Rex 101 Reputation points
2023-01-12T21:20:32.51+00:00

I have objects that I am adding to a list of Interface items. My properties on my objects are strings. I was wondeing how do I make sure that my properties have values? Thanks !!!

public class Pizza 
{
   public string pizzaSize {get;set;}
   public string pizzaType {get;set;}
   public string sauceType {get;set;}
}

public static List<IMenuItem> items=new List<IMenuItem>();
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,842 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,199 questions
{count} votes