Validate object properties

Ronald Rex 61 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.
902 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.
7,004 questions
{count} votes