BaseController<TUserState> Class

Westwind.AspNetCore.BaseController<TUserState>

Class Members

MemberDescription
Constructor
CreateUserState Use this to create a UserState instance - typically call from `Initialize()` method of controllerprior to action execution.
public TUserState CreateUserState()
CreateViewModel
public TViewModel CreateViewModel()
Initialize Initialize the controller by setting up UserState and ErrorDisplay
public void Initialize(ActionExecutingContext context)
InitializeViewModel Updates a ViewModel and adds values to some of thestock properties of the Controller.This default implementation initializes the ErrorDisplay and UserStateobjects after creation.
public void InitializeViewModel(BaseViewModel model)
JsonError Returns a Json error response to the client
public JsonResult JsonError(string errorMessage, int statusCode)
OnActionExecuted
public void OnActionExecuted(ActionExecutedContext context)
OnActionExecuting
public void OnActionExecuting(ActionExecutingContext context)
ReturnJsonError Returns a JSON error response to the client
public JsonResult ReturnJsonError(Exception ex, int statusCode)
UserState UserState instance that holds cached user data info thatgets persisted into an authentication cookie or token foreasy reuse without reloading a user record.Works with Auth Cookie or JWT token…
Namespace: Westwind.AspNetCore

Assembly: Westwind.AspNetCore.dll



© West Wind Technologies, 2025 • Updated: 2025-03-08
Comment or report problem with topic