Exemplo n.º 1
0
        public static async Task AdmitPatients(IEnumerable <Patient> listOfPatients, Dispatcher dispatcher)
        {
            foreach (var patient in listOfPatients)
            {
                await dispatcher.Dispatch(new AdmitPatient(
                                              patient.Id,
                                              patient.Name,
                                              patient.Age,
                                              DateTime.UtcNow,
                                              Ward.Get()));

                Console.WriteLine("Admitting: " + patient.Name);
            }
        }
Exemplo n.º 2
0
        public static async Task TransferPatients(List <Patient> listOfPatients, Dispatcher dispatcher)
        {
            for (var i = 0; i < 10; i++)
            {
                foreach (var patient in listOfPatients)
                {
                    var transfer = Random.Next(0, 5) == 0;
                    if (transfer)
                    {
                        await dispatcher.Dispatch(new TransferPatient(patient.Id, Ward.Get()));

                        Console.WriteLine("Transfering: " + patient.Name);
                    }
                }
            }
        }