C# Class ServiceStack.ServiceStackHost

Afficher le fichier Open project: ServiceStack/ServiceStack Class Usage Examples

Méthodes publiques

Méthode Description
AllowSetCookie ( IRequest req, string cookieName ) : bool
ApplyCustomHandlerRequestFilters ( IRequest httpReq, IResponse httpRes ) : bool

Apply PreRequest Filters for participating Custom Handlers, e.g. RazorFormat, MarkdownFormat, etc

ApplyMessageRequestFilters ( IRequest req, IResponse res, object requestDto ) : bool
ApplyMessageResponseFilters ( IRequest req, IResponse res, object response ) : bool
ApplyPreAuthenticateFilters ( IRequest httpReq, IResponse httpRes ) : void

Apply PreAuthenticate Filters from IAuthWithRequest AuthProviders

ApplyPreRequestFilters ( IRequest httpReq, IResponse httpRes ) : bool

Applies the raw request filters. Returns whether or not the request has been handled and no more processing should be done.

ApplyRequestConverters ( IRequest req, object requestDto ) : object
ApplyRequestFilters ( IRequest req, IResponse res, object requestDto ) : bool

Applies the request filters. Returns whether or not the request has been handled and no more processing should be done.

ApplyResponseConverters ( IRequest req, object responseDto ) : object
ApplyResponseFilters ( IRequest req, IResponse res, object response ) : bool

Applies the response filters. Returns whether or not the request has been handled and no more processing should be done.

AssertContentType ( string contentType ) : void
AssertFeatures ( Feature usesFeatures ) : void
ExecTypedFilters ( ITypedFilter>.Dictionary typedFilters, IRequest req, IResponse res, object dto ) : void
ExportSoapOperationTypes ( List operationTypes ) : List
ExportSoapType ( Type type ) : bool
GetAuthRepository ( IRequest req = null ) : IAuthRepository
GetCacheClient ( IRequest req ) : ICacheClient

Tries to resolve through Ioc container. If not registered, it falls back to .GetClient(); Called by itself, and

GetCookies ( IHttpResponse res ) : ICookies
GetCustomErrorHandler ( HttpStatusCode errorStatus ) : IServiceStackHandler
GetCustomErrorHandler ( int errorStatusCode ) : IServiceStackHandler
GetCustomErrorHttpHandler ( HttpStatusCode errorStatus ) : IHttpHandler
GetDbConnection ( IRequest req = null ) : IDbConnection

Gets IDbConnection Checks if DbInfo is seat in RequestContext. See multitenancy: https://github.com/ServiceStack/ServiceStack/wiki/Multitenancy Called by itself, and

GetDefaultSessionExpiry ( IRequest req ) : System.TimeSpan
GetMemoryCacheClient ( IRequest req ) : MemoryCacheClient

Returns . cache is only persisted for this running app instance. Called by .MemoryCacheClient

GetMessageProducer ( IRequest req = null ) : IMessageProducer

Returns from the IOC container. Called by itself, and

GetNotFoundHandler ( ) : IServiceStackHandler
GetRedisClient ( IRequest req = null ) : IRedisClient

Resolves based on .GetClient(); Called by itself, and

GetServiceGateway ( IRequest req ) : IServiceGateway
GetTypesConfigForMetadata ( IRequest req ) : MetadataTypesConfig
HandleErrorResponse ( IRequest httpReq, IResponse httpRes, HttpStatusCode errorStatus, string errorStatusDescription = null ) : void
HasAccessToMetadata ( IRequest httpReq, IResponse httpRes ) : bool
HasFeature ( Feature feature ) : bool
HasValidAuthSecret ( IRequest httpReq ) : bool
OnAfterExecute ( IRequest req, object requestDto, object response ) : object
OnExceptionTypeFilter ( Exception ex, ServiceStack.ResponseStatus responseStatus ) : void
OnLogError ( Type type, string message, Exception innerEx = null ) : void
OnSaveSession ( IRequest httpReq, IAuthSession session, System.TimeSpan expiresIn = null ) : void
OnSessionFilter ( IAuthSession session, string withSessionId ) : IAuthSession

Inspect or modify ever new UserSession created or resolved from cache. return null if Session is invalid to create new Session.

ResolveResponseException ( Exception ex ) : Exception
TryGetCurrentRequest ( ) : IRequest

Méthodes protégées

Méthode Description
ApplyRequestFiltersSingle ( IRequest req, IResponse res, object requestDto ) : bool
ApplyResponseFiltersSingle ( IRequest req, IResponse res, object response ) : bool

Method Details

AllowSetCookie() public méthode

public AllowSetCookie ( IRequest req, string cookieName ) : bool
req IRequest
cookieName string
Résultat bool

ApplyCustomHandlerRequestFilters() public méthode

Apply PreRequest Filters for participating Custom Handlers, e.g. RazorFormat, MarkdownFormat, etc
public ApplyCustomHandlerRequestFilters ( IRequest httpReq, IResponse httpRes ) : bool
httpReq IRequest
httpRes IResponse
Résultat bool

ApplyMessageRequestFilters() public méthode

public ApplyMessageRequestFilters ( IRequest req, IResponse res, object requestDto ) : bool
req IRequest
res IResponse
requestDto object
Résultat bool

ApplyMessageResponseFilters() public méthode

public ApplyMessageResponseFilters ( IRequest req, IResponse res, object response ) : bool
req IRequest
res IResponse
response object
Résultat bool

ApplyPreAuthenticateFilters() public méthode

Apply PreAuthenticate Filters from IAuthWithRequest AuthProviders
public ApplyPreAuthenticateFilters ( IRequest httpReq, IResponse httpRes ) : void
httpReq IRequest
httpRes IResponse
Résultat void

ApplyPreRequestFilters() public méthode

Applies the raw request filters. Returns whether or not the request has been handled and no more processing should be done.
public ApplyPreRequestFilters ( IRequest httpReq, IResponse httpRes ) : bool
httpReq IRequest
httpRes IResponse
Résultat bool

ApplyRequestConverters() public méthode

public ApplyRequestConverters ( IRequest req, object requestDto ) : object
req IRequest
requestDto object
Résultat object

ApplyRequestFilters() public méthode

Applies the request filters. Returns whether or not the request has been handled and no more processing should be done.
public ApplyRequestFilters ( IRequest req, IResponse res, object requestDto ) : bool
req IRequest
res IResponse
requestDto object
Résultat bool

ApplyRequestFiltersSingle() protected méthode

protected ApplyRequestFiltersSingle ( IRequest req, IResponse res, object requestDto ) : bool
req IRequest
res IResponse
requestDto object
Résultat bool

ApplyResponseConverters() public méthode

public ApplyResponseConverters ( IRequest req, object responseDto ) : object
req IRequest
responseDto object
Résultat object

ApplyResponseFilters() public méthode

Applies the response filters. Returns whether or not the request has been handled and no more processing should be done.
public ApplyResponseFilters ( IRequest req, IResponse res, object response ) : bool
req IRequest
res IResponse
response object
Résultat bool

ApplyResponseFiltersSingle() protected méthode

protected ApplyResponseFiltersSingle ( IRequest req, IResponse res, object response ) : bool
req IRequest
res IResponse
response object
Résultat bool

AssertContentType() public méthode

public AssertContentType ( string contentType ) : void
contentType string
Résultat void

AssertFeatures() public méthode

public AssertFeatures ( Feature usesFeatures ) : void
usesFeatures Feature
Résultat void

ExecTypedFilters() public méthode

public ExecTypedFilters ( ITypedFilter>.Dictionary typedFilters, IRequest req, IResponse res, object dto ) : void
typedFilters ITypedFilter>.Dictionary
req IRequest
res IResponse
dto object
Résultat void

ExportSoapOperationTypes() public méthode

public ExportSoapOperationTypes ( List operationTypes ) : List
operationTypes List
Résultat List

ExportSoapType() public méthode

public ExportSoapType ( Type type ) : bool
type System.Type
Résultat bool

GetAuthRepository() public méthode

public GetAuthRepository ( IRequest req = null ) : IAuthRepository
req IRequest
Résultat IAuthRepository

GetCacheClient() public méthode

Tries to resolve through Ioc container. If not registered, it falls back to .GetClient(); Called by itself, and
public GetCacheClient ( IRequest req ) : ICacheClient
req IRequest Provided by services and pageView, can be helpfull when overriding this method
Résultat ICacheClient

GetCookies() public méthode

public GetCookies ( IHttpResponse res ) : ICookies
res IHttpResponse
Résultat ICookies

GetCustomErrorHandler() public méthode

public GetCustomErrorHandler ( HttpStatusCode errorStatus ) : IServiceStackHandler
errorStatus HttpStatusCode
Résultat IServiceStackHandler

GetCustomErrorHandler() public méthode

public GetCustomErrorHandler ( int errorStatusCode ) : IServiceStackHandler
errorStatusCode int
Résultat IServiceStackHandler

GetCustomErrorHttpHandler() public méthode

public GetCustomErrorHttpHandler ( HttpStatusCode errorStatus ) : IHttpHandler
errorStatus HttpStatusCode
Résultat IHttpHandler

GetDbConnection() public méthode

Gets IDbConnection Checks if DbInfo is seat in RequestContext. See multitenancy: https://github.com/ServiceStack/ServiceStack/wiki/Multitenancy Called by itself, and
public GetDbConnection ( IRequest req = null ) : IDbConnection
req IRequest Provided by services and pageView, can be helpfull when overriding this method
Résultat IDbConnection

GetDefaultSessionExpiry() public méthode

public GetDefaultSessionExpiry ( IRequest req ) : System.TimeSpan
req IRequest
Résultat System.TimeSpan

GetMemoryCacheClient() public méthode

Returns . cache is only persisted for this running app instance. Called by .MemoryCacheClient
public GetMemoryCacheClient ( IRequest req ) : MemoryCacheClient
req IRequest Provided by services and pageView, can be helpfull when overriding this method
Résultat MemoryCacheClient

GetMessageProducer() public méthode

Returns from the IOC container. Called by itself, and
public GetMessageProducer ( IRequest req = null ) : IMessageProducer
req IRequest Provided by services and PageViewBase, can be helpfull when overriding this method
Résultat IMessageProducer

GetNotFoundHandler() public méthode

public GetNotFoundHandler ( ) : IServiceStackHandler
Résultat IServiceStackHandler

GetRedisClient() public méthode

Resolves based on .GetClient(); Called by itself, and
public GetRedisClient ( IRequest req = null ) : IRedisClient
req IRequest Provided by services and pageView, can be helpfull when overriding this method
Résultat IRedisClient

GetServiceGateway() public méthode

public GetServiceGateway ( IRequest req ) : IServiceGateway
req IRequest
Résultat IServiceGateway

GetTypesConfigForMetadata() public méthode

public GetTypesConfigForMetadata ( IRequest req ) : MetadataTypesConfig
req IRequest
Résultat MetadataTypesConfig

HandleErrorResponse() public méthode

public HandleErrorResponse ( IRequest httpReq, IResponse httpRes, HttpStatusCode errorStatus, string errorStatusDescription = null ) : void
httpReq IRequest
httpRes IResponse
errorStatus HttpStatusCode
errorStatusDescription string
Résultat void

HasAccessToMetadata() public méthode

public HasAccessToMetadata ( IRequest httpReq, IResponse httpRes ) : bool
httpReq IRequest
httpRes IResponse
Résultat bool

HasFeature() public méthode

public HasFeature ( Feature feature ) : bool
feature Feature
Résultat bool

HasValidAuthSecret() public méthode

public HasValidAuthSecret ( IRequest httpReq ) : bool
httpReq IRequest
Résultat bool

OnAfterExecute() public méthode

public OnAfterExecute ( IRequest req, object requestDto, object response ) : object
req IRequest
requestDto object
response object
Résultat object

OnExceptionTypeFilter() public méthode

public OnExceptionTypeFilter ( Exception ex, ServiceStack.ResponseStatus responseStatus ) : void
ex System.Exception
responseStatus ServiceStack.ResponseStatus
Résultat void

OnLogError() public méthode

public OnLogError ( Type type, string message, Exception innerEx = null ) : void
type System.Type
message string
innerEx System.Exception
Résultat void

OnSaveSession() public méthode

public OnSaveSession ( IRequest httpReq, IAuthSession session, System.TimeSpan expiresIn = null ) : void
httpReq IRequest
session IAuthSession
expiresIn System.TimeSpan
Résultat void

OnSessionFilter() public méthode

Inspect or modify ever new UserSession created or resolved from cache. return null if Session is invalid to create new Session.
public OnSessionFilter ( IAuthSession session, string withSessionId ) : IAuthSession
session IAuthSession
withSessionId string
Résultat IAuthSession

ResolveResponseException() public méthode

public ResolveResponseException ( Exception ex ) : Exception
ex System.Exception
Résultat System.Exception

TryGetCurrentRequest() public méthode

public TryGetCurrentRequest ( ) : IRequest
Résultat IRequest