private void CheckAutoroute(UpdateContentContext context, ShortLinksPart part)
        {
            var fullAbsoluteUrl = _shortLinkService.GetFullAbsoluteUrl(part);

            if (!string.IsNullOrEmpty(part.FullLink) && part.FullLink != fullAbsoluteUrl)
            {
                _notifier.Warning(T("The short link is not associated to this page!"));
            }
        }
Esempio n. 2
0
        //POST
        protected override DriverResult Editor(
            ShortLinksPart part, IUpdateModel updater, dynamic shapeHelper)
        {
            if (updater.TryUpdateModel(part, Prefix, null, null))
            {
                if (string.IsNullOrEmpty(part.Url))
                {
                    part.FullLink = string.Empty;
                }
                else if (string.IsNullOrEmpty(part.FullLink))     // se sono qui è perchè l'utente ha scritto a mano lo short link e bisogna inserire il full link.
                {
                    _shortLinkService.GetFullAbsoluteUrl(part);
                }
            }

            return(Editor(part, shapeHelper));
        }