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
Type | Name |
---|---|
System.Object | data |
GetSession(Boolean)
View Source
Declaration
protected virtual IAuthSession GetSession(bool reload = true)
Returns
ServiceStack.Auth.IAuthSession
Parameters
Type | Name |
---|---|
System.Boolean | reload |
GetSessionAsync(Boolean, CancellationToken)
View Source
Declaration
protected virtual Task<IAuthSession> GetSessionAsync(bool reload = false, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IAuthSession>
Parameters
Type | Name |
---|---|
System.Boolean | reload |
CancellationToken | token |
SessionAsAsync<TUserSession>(CancellationToken)
View Source
Declaration
protected virtual Task<TUserSession> SessionAsAsync<TUserSession>(CancellationToken token = null)
Returns
Task<<TUserSession>>
Parameters
Type | Name |
---|---|
CancellationToken | token |
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
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
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
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.Nullable<TimeSpan> | expiresIn |
CancellationToken | token |
ClearSession()
View Source
Declaration
protected virtual void ClearSession()
ClearSessionAsync(CancellationToken)
View Source
Declaration
protected virtual Task ClearSessionAsync(CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
CancellationToken | token |
Dispose(Boolean)
View Source
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name |
---|---|
System.Boolean | disposing |
EndServiceStackRequest()
View Source
Declaration
protected virtual void EndServiceStackRequest()