Skip to content

UriExtensions

Derives ASP.NET MVC-style application/controller/action/page name fragments from a request Uri's path segments. (BR-068, BR-069, BR-070)

Purpose

  • Derives ASP.NET MVC-style application/controller/action/page name fragments from a request Uri's path segments. (BR-068, BR-069, BR-070)

Context

  • Namespace: SAIF.Common.Extensions
  • Assembly/package: SAIF.Framework.Common

Public members

Member Signature Purpose
ApplicationName(this Uri uri) public static string ApplicationName(this Uri uri) Extracts the virtual application/root segment of the URI path. (BR-068)
PageName(this Uri uri) public static string PageName(this Uri uri) Extracts the final path segment (page/resource name). (BR-069)
ControllerAndActionName(this Uri uri) public static string ControllerAndActionName(this Uri uri) Concatenates URL segments 2 and 3 (controller and action) when both are present, appends "Index" to segment 2 when only the controller segment is present, and otherwise defaults to "Home/Index". (BR-070)

Sources

  • Common/SAIF.Common/Extensions/UriExtensions.cs