public string AsView(string incView)
 {
     defaultRoutes.Add("incView", incView);
     // ReSharper disable once Mvc.ActionNotResolved
     // ReSharper disable once Mvc.ControllerNotResolved
     return(StringUrlExtensions.AppendToQueryString(urlHelper.Action("Render", "Dispatcher", defaultRoutes), query));
 }
 public string AsFile(string incContentType = "", string incFileDownloadName = "")
 {
     // ReSharper disable once Mvc.ActionNotResolved
     // ReSharper disable once Mvc.ControllerNotResolved
     return(StringUrlExtensions.AppendToQueryString(urlHelper.Action("QueryToFile", "Dispatcher", defaultRoutes), new
     {
         incContentType = incContentType,
         incFileDownloadName = incFileDownloadName
     })
            .AppendToQueryString(query));
 }
 public string AsView([AspMvcPartialView, NotNull] string incView)
 {
     defaultRoutes.Add("incView", incView);
     // ReSharper disable once Mvc.ActionNotResolved
     // ReSharper disable once Mvc.ControllerNotResolved
     return(StringUrlExtensions.AppendToQueryString(urlHelper.Action("Render", "Dispatcher", defaultRoutes), GetQueryString(new Dictionary <Type, List <object> >()
     {
         { typeof(TModel), new List <object>()
           {
               this.model
           } }
     })));
 }
Exemple #4
0
        static string InternalHash(this IUrlHelper urlHelper, [AspMvcAction] string action, [AspMvcController] string controller, Uri uri, [AspMvcArea] string area = "", object routes = null)
        {
            string baseUrl = "/";

            if (uri.If(r => r.Segments.Length > 1).Has())
            {
                baseUrl = baseUrl
                          .AppendSegment(uri.Segments[0])
                          .AppendSegment(uri.Segments[1].Replace("/", string.Empty));
            }

            string urlHash = StringUrlExtensions.AppendToHashQueryString(area
                                                                         .Not(string.IsNullOrWhiteSpace)
                                                                         .ReturnOrDefault(r => ActionArea(urlHelper, action, controller, area), urlHelper.Action(action, controller)), routes, true);

            return(HttpUtility.UrlDecode(baseUrl.SetHash(urlHash)));
        }
            public override string ToString()
            {
                var routeValues = new RouteValueDictionary {
                    { "incTypes", StringExtensions.AsString(dictionary.Select(r => GetTypeName(r.Key)), separatorByType) }
                };

                if (isCompositeAsArray)
                {
                    routeValues.Add("incIsCompositeAsArray", true);
                }
                if (onlyValidate)
                {
                    routeValues.Add("incOnlyValidate", true);
                }
                // ReSharper disable once Mvc.ActionNotResolved
                // ReSharper disable once Mvc.ControllerNotResolved
                return(StringUrlExtensions.AppendToQueryString(urlHelper.Action("Push", "Dispatcher", routeValues), GetQueryString(this.dictionary)));
            }
 public string AsJson()
 {
     // ReSharper disable once Mvc.ActionNotResolved
     // ReSharper disable once Mvc.ControllerNotResolved
     return(StringUrlExtensions.AppendToQueryString(urlHelper.Action("Query", "Dispatcher", defaultRoutes), query));
 }