Пример #1
0
        private string GetFullyQualifiedPageName(RazorPage razorPage)
        {
            string escapedNs    = Namespace.Escape(razorPage.Data.Namespace?.Text);
            string escapedClass = string.IsNullOrWhiteSpace(razorPage.Data.Class?.Text) ? "" : CSharp.Identifier(razorPage.Data.Class.Text.Trim());

            if (escapedClass.Length == 0 && escapedNs.Length == 0)
            {
                return("<invalid>");
            }
            else if (escapedNs.Length == 0)
            {
                return($"global::{escapedClass}");
            }
            else if (escapedClass.Length == 0)
            {
                return($"{escapedNs}.<invalid>");
            }
            else
            {
                return($"{escapedNs}.{escapedClass}");
            }
        }