Ejemplo n.º 1
0
        public async Task <int> CreateUserStepThree(RegistrationStepThree data)
        {
            var request = new PutModifyRegistrationPageThreeRequest()
            {
                RegistrationStepThree = data
            };

            var response = await PutAsync <ResponseWrapper <PutModifyRegistrationPageThreeResponse, UserServiceErrorCode> >("/api/PutModifyRegistrationPageThree", request);

            if (response.HasContent && response.IsSuccessful)
            {
                return(response.Content.ID);
            }
            else
            {
                throw new Exception($"Unsuccessful response from PutModifyRegistrationPageThree.  Errors: {response.Errors}");
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "put", Route = null)]
            [RequestBodyType(typeof(PutModifyRegistrationPageThreeRequest), "Put Modify Registration Page Three")] PutModifyRegistrationPageThreeRequest req,
            ILogger log)
        {
            try
            {
                NewRelic.Api.Agent.NewRelic.SetTransactionName("UserService", "PutModifyRegistrationPageThree");
                log.LogInformation("C# HTTP trigger function processed a request.");

                PutModifyRegistrationPageThreeResponse response = await _mediator.Send(req);

                return(new OkObjectResult(ResponseWrapper <PutModifyRegistrationPageThreeResponse, UserServiceErrorCode> .CreateSuccessfulResponse(response)));
            }
            catch (Exception exc)
            {
                LogError.Log(log, exc, req);

                return(new ObjectResult(ResponseWrapper <PutModifyRegistrationPageThreeResponse, UserServiceErrorCode> .CreateUnsuccessfulResponse(UserServiceErrorCode.UnhandledError, "Internal Error"))
                {
                    StatusCode = StatusCodes.Status500InternalServerError
                });
            }
        }