private void HandleResult(GuestControllerResult <SiteConfigurationResponse> gcResult, Action <IInternalGetRegistrationConfigurationResult> callback)
    {
        SiteConfigurationResponse response = gcResult.Response;

        if (!gcResult.Success)
        {
            callback(new GetRegistrationConfigurationResult(success: false, null));
            return;
        }
        IInternalGetRegistrationConfigurationResult regConfigResult = GuestControllerErrorParser.GetRegConfigResult(response.error);

        if (regConfigResult != null)
        {
            callback(regConfigResult);
            return;
        }
        if (!ValidateResponse(response))
        {
            callback(new GetRegistrationConfigurationResult(success: false, null));
            return;
        }
        RegistrationConfiguration configuration = new RegistrationConfiguration(response.data, ageBandBuilder);

        callback(new GetRegistrationConfigurationResult(success: true, configuration));
    }
        private void HandleGetRegistrationConfiguration(IInternalGetRegistrationConfigurationResult result, ISession session, GuestApiErrorCollection errors, Action <BuildLegalMarketingErrorsResult> successCallback, Action failureCallback)
        {
            IInternalRegistrationConfiguration internalConfiguration = result.InternalConfiguration;

            if (!result.Success || internalConfiguration == null)
            {
                session.Dispose();
                failureCallback();
                return;
            }
            int age = CalculateAge(session.LocalUser.RegistrationProfile.DateOfBirth);

            internalConfiguration.GetUpdateAgeBand(session.LocalUser.RegistrationProfile.AgeBandKey, age, languagePreference, delegate(IGetAgeBandResult bandResult)
            {
                if (!bandResult.Success)
                {
                    session.Dispose();
                    failureCallback();
                }
                else
                {
                    FindMatches(bandResult.AgeBand, errors, successCallback, failureCallback);
                }
            });
        }