Skip to main content

ServiceStackController

Assembly: ServiceStack.Mvc.dll
View Source
Declaration
public abstract class ServiceStackController : Controller, IHasServiceStackProvider

Properties

UnauthorizedRedirectUrl

Default redirect URL if [Authenticate] attribute doesn't permit access.

View Source
Declaration
public virtual string UnauthorizedRedirectUrl { get; }

AuthenticationErrorResult

To change the error result when authentication (ServiceStack.AuthenticateAttribute) fails. Override this property and return the appropriate result.

View Source
Declaration
public virtual ActionResult AuthenticationErrorResult { get; }

ForbiddenRedirectUrl

Default redirect URL if Required Role or Permission attributes doesn't permit access.

View Source
Declaration
public virtual string ForbiddenRedirectUrl { get; }

ForbiddenErrorResult

To change the error result when user doesn't have required role or permissions (ServiceStack.RequiredRoleAttribute). Override this property and return the appropriate result.

View Source
Declaration
public virtual ActionResult ForbiddenErrorResult { get; }

AuthorizationErrorResult

To change the error result when authorization fails to something else, override this property and return the appropriate result.

View Source
Declaration
public virtual ActionResult AuthorizationErrorResult { get; }

ServiceStackProvider

View Source
Declaration
public virtual IServiceStackProvider ServiceStackProvider { get; }

AppSettings

View Source
Declaration
public virtual IAppSettings AppSettings { get; }

ServiceStackRequest

View Source
Declaration
public virtual IHttpRequest ServiceStackRequest { get; }

ServiceStackResponse

View Source
Declaration
public virtual IHttpResponse ServiceStackResponse { get; }

Cache

View Source
Declaration
public virtual ICacheClient Cache { get; }

CacheAsync

View Source
Declaration
public virtual ICacheClientAsync CacheAsync { get; }

Db

View Source
Declaration
public virtual IDbConnection Db { get; }

Redis

View Source
Declaration
public virtual IRedisClient Redis { get; }

MessageProducer

View Source
Declaration
public virtual IMessageProducer MessageProducer { get; }

AuthRepository

View Source
Declaration
public virtual IAuthRepository AuthRepository { get; }

AuthRepositoryAsync

View Source
Declaration
public virtual IAuthRepositoryAsync AuthRepositoryAsync { get; }

SessionFactory

View Source
Declaration
public virtual ISessionFactory SessionFactory { get; }

SessionBag

View Source
Declaration
public virtual ISession SessionBag { get; }

SessionBagAsync

View Source
Declaration
public virtual ISessionAsync SessionBagAsync { get; }

IsAuthenticated

View Source
Declaration
public virtual bool IsAuthenticated { get; }

Gateway

View Source
Declaration
public virtual IServiceGateway Gateway { get; }

RpcGateway

View Source
Declaration
public virtual RpcGateway RpcGateway { get; }

Fields

DefaultAction

View Source
Declaration
public static string DefaultAction

Methods

Json(Object)

View Source
Declaration
public override JsonResult Json(object data)
Returns

JsonResult

Parameters
TypeName
System.Objectdata

GetSession(Boolean)

View Source
Declaration
protected virtual IAuthSession GetSession(bool reload = true)
Returns

ServiceStack.Auth.IAuthSession

Parameters
TypeName
System.Booleanreload

GetSessionAsync(Boolean, CancellationToken)

View Source
Declaration
protected virtual Task<IAuthSession> GetSessionAsync(bool reload = false, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IAuthSession>

Parameters
TypeName
System.Booleanreload
CancellationTokentoken

SessionAsAsync<TUserSession>(CancellationToken)

View Source
Declaration
protected virtual Task<TUserSession> SessionAsAsync<TUserSession>(CancellationToken token = null)
Returns

Task<<TUserSession>>

Parameters
TypeName
CancellationTokentoken
Type Parameters
  • TUserSession

SessionAs<TUserSession>()

View Source
Declaration
protected virtual TUserSession SessionAs<TUserSession>()
Returns

<TUserSession>

Type Parameters
  • TUserSession

SaveSession(IAuthSession, Nullable<TimeSpan>)

View Source
Declaration
protected virtual void SaveSession(IAuthSession session, TimeSpan? expiresIn = null)
Parameters
TypeName
ServiceStack.Auth.IAuthSessionsession
System.Nullable<TimeSpan>expiresIn

SaveSessionAsync(IAuthSession, Nullable<TimeSpan>, CancellationToken)

View Source
Declaration
protected virtual Task SaveSessionAsync(IAuthSession session, TimeSpan? expiresIn = null, CancellationToken token = null)
Returns

Task

Parameters
TypeName
ServiceStack.Auth.IAuthSessionsession
System.Nullable<TimeSpan>expiresIn
CancellationTokentoken

ClearSession()

View Source
Declaration
protected virtual void ClearSession()

ClearSessionAsync(CancellationToken)

View Source
Declaration
protected virtual Task ClearSessionAsync(CancellationToken token = null)
Returns

Task

Parameters
TypeName
CancellationTokentoken

Dispose(Boolean)

View Source
Declaration
protected override void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

EndServiceStackRequest()

View Source
Declaration
protected virtual void EndServiceStackRequest()

Implements