I've a class. How to set default value of the class properties to "na" in case they are null.
public class PharmacyOrder
{
public class MedicineRecord
{
// how to set default value "na" for these properties
public string MedicineId { get; set; }
public string MedicineName { get; set; }
public string MedicineDealer { get; set; }
}
}
this MedicineRecord is called from another class.
public PharmacyOrder.MedicineRecord SetMedicineRecord()
{
PharmacyOrder.MedicineRecord obj = new PharmacyOrder.MedicineRecord();
obj.MedicineId = // assigned values
// for other properties too
}
how to set default value of the properties to "na" to assign default value when null is passed?