Example #1
0
        public async Task <IActionResult> Post([FromBody] RegisterInput input)
        {
            var patient = new Patient {
                Id        = input.Id,
                BirthDate = input.BirthDate,
                Email     = input.Email,
                FirstName = input.FirstName,
                LastName  = input.LastName,
                Illness   = input.Illness,
            };
            var result = await _patientsService.AddPatient(patient);

            return(CreatedAtAction($"{result.State}", new
            {
                result.Entity
            }));
        }
Example #2
0
        public async Task <ActionResult <Guid> > PostPatient([FromBody] Patient patient)
        {
            var id = _patientsService.AddPatient(patient);

            return(StatusCode(201, new { Id = id }));
        }