public static string Controller() { if (AspNetCoreHttpContext.Current != null) { var controller = Url.RouteData("controller").ToLower(); if (!string.IsNullOrEmpty(controller)) { return(controller); } } return(StackTraces.Class()); }
public static string Controller() { return(RouteTable.Routes.Count != 0 && HttpContext.Current != null ? Url.RouteData("controller").ToString().ToLower() : StackTraces.Class()); }
private static string GetController() { return(HasRoute() ? Url.RouteData("controller").ToString().ToLower() : StackTraces.Class()); }