public async Task <IActionResult> SignUp([FromBody] MarathonSignUp signUpCredentials)
        {
            if (signUpCredentials == null)
            {
                return(BadRequest());
            }

            try
            {
                int marathonSignUpId = await _marathonService.SignUp(signUpCredentials);

                return(Ok(marathonSignUpId));
            }
            catch
            {
                return(BadRequest());
            }
        }
        public async Task <int> SignUp(MarathonSignUp signUpCredentials)
        {
            var marathonSignUp = new Domain.Entities.MarathonSignUp
            {
                RunnerId          = signUpCredentials.RunnerId,
                SignUpDate        = DateTime.UtcNow,
                RaceKitOptionId   = signUpCredentials.RaceKitOptionId,
                SignUpStatusId    = SignUpStatus.SignedUp.Id,
                Cost              = signUpCredentials.Cost,
                CharityId         = signUpCredentials.CharityId,
                SponsorshipTarget = signUpCredentials.SponsorshipTarget
            };

            try
            {
                SignUpRunner(marathonSignUp)
                .Wait();
            }
            catch
            {
                throw new Exception("Error has given when created a marathon sign up record");
            }


            try
            {
                SignUpRunnerToEvents(marathonSignUp.Id, GetEventsByEventType(signUpCredentials.EventTypeId))
                .Wait();
            }
            catch
            {
                await RemoveMarathonSignUp(marathonSignUp.Id).ContinueWith(x => throw new Exception("Error has given when signed up runner to events"));
            }

            return(marathonSignUp.Id);
        }
        public Task <int> SignUp(MarathonSignUp signUpCredentials)
        {
            var uri = UriHelper.CombineUri(GlobalSettings.Instance.SignUpToMarathon);

            return(_requestProvider.PostAsync <MarathonSignUp, int>(uri, signUpCredentials, this.GetToken()));
        }