示例#1
0
        private void FillInitialData()
        {
            AppointmentManager appointmentManager = new AppointmentManager(_appointmentContext);
            var list = appointmentManager.GetAllItemsAsync().Result;

            if (list.Count < 3)
            {
                var x = appointmentManager.CreateAsync(new Appointment()
                {
                    PatientId           = "19860813-1111",
                    DoctorId            = "201012-1425",
                    AppointmentDate     = DateTime.UtcNow.AddDays(1).Date,
                    AppointmentTimeSlot = 1
                }).Result;

                x = appointmentManager.CreateAsync(new Appointment()
                {
                    PatientId           = "19750612-2222",
                    DoctorId            = "201012-1425",
                    AppointmentDate     = DateTime.UtcNow.AddDays(1).Date,
                    AppointmentTimeSlot = 3
                }).Result;

                x = appointmentManager.CreateAsync(new Appointment()
                {
                    PatientId           = "19860813-1111",
                    DoctorId            = "201012-1425",
                    AppointmentDate     = DateTime.UtcNow.AddDays(1).Date,
                    AppointmentTimeSlot = 1
                }).Result;
            }
        }