Пример #1
0
        public IActionResult Add(Patient p)
        {
            _context.Patients.Add(p);
            _context.SaveChanges();

            return(Created("/api/patients/", p));
        }
        public IActionResult AddPatient(Patient patient)
        {
            patient.TestPositiveDate = DateTime.Now.ToString("MM/dd/yyyy");
            _context.Patients.Add(patient);
            _context.SaveChanges();

            return(Created("/api/patients", patient));
        }
        public async Task <IActionResult> Add(Patient p)
        {
            _context.Patients.Add(p);
            _context.SaveChanges();

            await _sender.SendMessage(new MessagePayload()
            {
                EventName = "NewUserRegistered", UserEmail = "*****@*****.**"
            });

            return(Created("api/patients/", p));
        }
Пример #4
0
        public async Task <IActionResult> RegisterPatient(Patient patient)
        {
            _context.Patients.Add(patient);
            _context.SaveChanges();

            await _sender.SendMessage(new MessagePayLoad()
            {
                EventName = "NewUserRegistered",
                UserEmail = "*****@*****.**"
            });

            return(Created("/api/patients/", patient));
        }
        public async Task <IActionResult> PostPatient(Patient newPatient)
        {
            _context.Patients.Add(newPatient);
            _context.SaveChanges();

            await _sender.SendMessage(new MessagePayload()
            {
                EventName = "NewUserRegistered", UserEmail = newPatient.Email
            });

            int id = newPatient.Id;

            return(Created("/api/patients/", id));
        }