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