26 lines
1.0 KiB
C#
26 lines
1.0 KiB
C#
namespace Microsoft.AspNetCore.Mvc
|
|
{
|
|
using Microsoft.AspNetCore.Http;
|
|
using Kit.Helpers;
|
|
|
|
public class LayoutModel
|
|
{
|
|
//public abstract LayoutMenuTabs LayoutMenuTabActive { get; }
|
|
public string CurrentUrl { get; private set; } = string.Empty;
|
|
public string ControllerName { get; private set; } = string.Empty;
|
|
public string ActionName { get; private set; } = string.Empty;
|
|
|
|
public virtual string ActionCreateGet => "CreateGet";
|
|
public virtual string ActionCreatePost => "CreatePost";
|
|
public virtual string ActionEditGet => "EditGet";
|
|
public virtual string ActionEditPost => "EditPost";
|
|
|
|
public void Fill(HttpContext httpContext, ControllerContext controllerContext)
|
|
{
|
|
CurrentUrl = httpContext.Request.AbsoluteUrl(checkForwardedProto: true);
|
|
ControllerName = controllerContext.ActionDescriptor?.ControllerName ?? string.Empty;
|
|
ActionName = controllerContext.ActionDescriptor?.ActionName ?? string.Empty;
|
|
}
|
|
}
|
|
}
|