I am working with a hospital system and I would like to know how I could export the information of my objects to files with a readable format such as JSON
or XML
, to be used as input to another program that processes them.
These are my classes:
public class Patient
{
public string PatienName { get; set; }
public int Age { get; set; }
public char Sex { get; set; }
public string Address { get; set; }
public Illness Illness { get; set; }
public Bed Bed { get; set; }
}
public class Bed
{
public int BedNumber { get; set; }
public string Aisle { get; set; }
}
public class Illness
{
public IllnessType Type { get; set; }
public string IllnessName { get; set; }
}
public class IllnessType
{
public string IllnessTypeName { get; set; }
public string Severity { get; set; }
}