public static string GetStartLoadingContactUrl(this ContactIdentificationViewModel contactIdentificationViewModel, IUrlHelper urlHelper)
        {
            NullGuard.NotNull(contactIdentificationViewModel, nameof(contactIdentificationViewModel))
            .NotNull(urlHelper, nameof(urlHelper));

            return(urlHelper.AbsoluteAction("StartLoadingContact", "Contact", new { contactIdentificationViewModel.ExternalIdentifier, CountryCode = "{countryCode}" }));
        }
        public static string GetLoadContactUrl(this ContactIdentificationViewModel contactIdentificationViewModel, IUrlHelper urlHelper, string countryCode)
        {
            NullGuard.NotNull(contactIdentificationViewModel, nameof(contactIdentificationViewModel))
            .NotNull(urlHelper, nameof(urlHelper))
            .NotNullOrWhiteSpace(countryCode, nameof(countryCode));

            return(urlHelper.AbsoluteAction("LoadContact", "Contact", new { contactIdentificationViewModel.ExternalIdentifier, CountryCode = countryCode }));
        }
Exemplo n.º 3
0
        public static string GetStartLoadingContactUrlForExternalIdentifier(this ContactOptionsViewModel contactOptionsViewModel, IUrlHelper urlHelper)
        {
            NullGuard.NotNull(contactOptionsViewModel, nameof(contactOptionsViewModel))
            .NotNull(urlHelper, nameof(urlHelper));

            if (string.IsNullOrWhiteSpace(contactOptionsViewModel.ExternalIdentifier))
            {
                return(null);
            }

            ContactIdentificationViewModel contactIdentificationViewModel = new ContactIdentificationViewModel
            {
                ExternalIdentifier = contactOptionsViewModel.ExternalIdentifier
            };

            return(contactIdentificationViewModel.GetStartLoadingContactUrl(urlHelper));
        }