Beispiel #1
0
        public async Task <IActionResult> Post([FromBody] RegistrationModel registration)
        {
            if (registration == null)
            {
                return(BadRequest());
            }

            await _bus.Send <ISubmitRegistration>(registration);

            RegistrationResponseModel response = new RegistrationResponseModel()
            {
                SubmissionId = registration.SubmissionId
            };

            return(Ok());
        }
        // POST api/<controller>
        public async Task <HttpResponseMessage> Post([FromBody] RegistrationModel registration)
        {
            await WebApiApplication.Bus.Send <SubmitRegistration>(registration);


            var urlHelper = new UrlHelper(Request);

            var response = new RegistrationResponseModel
            {
                SubmissionId = registration.SubmissionId,
                Actions      = new Dictionary <string, Uri>
                {
                    { "Status", new Uri(urlHelper.Link("RegistrationStatus", new { submissionId = registration.SubmissionId })) }
                }
            };

            return(Request.CreateResponse(HttpStatusCode.Accepted, response));
        }