Mark Tabor

Mark Tabor

  • 571
  • 1.9k
  • 430k

How to create instance of property in C#

Sep 16 2021 6:58 AM

I have a calls with this defination 

public class Hospital
  {
        public List<Patient> patients { get; set; }
        public string Name { get; set; }

        public Hospital()
        {
            patients = new List<Patient>();
        }
    }

How to create patient instance inside hospital instace patients Field by using add mthod in program.cs class


Answers (2)