C# Class ServiceStack.ServiceStackHost

Exibir arquivo Open project: ServiceStack/ServiceStack Class Usage Examples

Public Methods

Method 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

Protected Methods

Method Description
ApplyRequestFiltersSingle ( IRequest req, IResponse res, object requestDto ) : bool
ApplyResponseFiltersSingle ( IRequest req, IResponse res, object response ) : bool

Method Details

AllowSetCookie() public method

public AllowSetCookie ( IRequest req, string cookieName ) : bool
req IRequest
cookieName string
return bool

ApplyCustomHandlerRequestFilters() public method

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

ApplyMessageRequestFilters() public method

public ApplyMessageRequestFilters ( IRequest req, IResponse res, object requestDto ) : bool
req IRequest
res IResponse
requestDto object
return bool

ApplyMessageResponseFilters() public method

public ApplyMessageResponseFilters ( IRequest req, IResponse res, object response ) : bool
req IRequest
res IResponse
response object
return bool

ApplyPreAuthenticateFilters() public method

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

ApplyPreRequestFilters() public method

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
return bool

ApplyRequestConverters() public method

public ApplyRequestConverters ( IRequest req, object requestDto ) : object
req IRequest
requestDto object
return object

ApplyRequestFilters() public method

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
return bool

ApplyRequestFiltersSingle() protected method

protected ApplyRequestFiltersSingle ( IRequest req, IResponse res, object requestDto ) : bool
req IRequest
res IResponse
requestDto object
return bool

ApplyResponseConverters() public method

public ApplyResponseConverters ( IRequest req, object responseDto ) : object
req IRequest
responseDto object
return object

ApplyResponseFilters() public method

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
return bool

ApplyResponseFiltersSingle() protected method

protected ApplyResponseFiltersSingle ( IRequest req, IResponse res, object response ) : bool
req IRequest
res IResponse
response object
return bool

AssertContentType() public method

public AssertContentType ( string contentType ) : void
contentType string
return void

AssertFeatures() public method

public AssertFeatures ( Feature usesFeatures ) : void
usesFeatures Feature
return void

ExecTypedFilters() public method

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

ExportSoapOperationTypes() public method

public ExportSoapOperationTypes ( List operationTypes ) : List
operationTypes List
return List

ExportSoapType() public method

public ExportSoapType ( Type type ) : bool
type System.Type
return bool

GetAuthRepository() public method

public GetAuthRepository ( IRequest req = null ) : IAuthRepository
req IRequest
return IAuthRepository

GetCacheClient() public method

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
return ICacheClient

GetCookies() public method

public GetCookies ( IHttpResponse res ) : ICookies
res IHttpResponse
return ICookies

GetCustomErrorHandler() public method

public GetCustomErrorHandler ( HttpStatusCode errorStatus ) : IServiceStackHandler
errorStatus HttpStatusCode
return IServiceStackHandler

GetCustomErrorHandler() public method

public GetCustomErrorHandler ( int errorStatusCode ) : IServiceStackHandler
errorStatusCode int
return IServiceStackHandler

GetCustomErrorHttpHandler() public method

public GetCustomErrorHttpHandler ( HttpStatusCode errorStatus ) : IHttpHandler
errorStatus HttpStatusCode
return IHttpHandler

GetDbConnection() public method

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
return IDbConnection

GetDefaultSessionExpiry() public method

public GetDefaultSessionExpiry ( IRequest req ) : System.TimeSpan
req IRequest
return System.TimeSpan

GetMemoryCacheClient() public method

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
return MemoryCacheClient

GetMessageProducer() public method

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
return IMessageProducer

GetNotFoundHandler() public method

public GetNotFoundHandler ( ) : IServiceStackHandler
return IServiceStackHandler

GetRedisClient() public method

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
return IRedisClient

GetServiceGateway() public method

public GetServiceGateway ( IRequest req ) : IServiceGateway
req IRequest
return IServiceGateway

GetTypesConfigForMetadata() public method

public GetTypesConfigForMetadata ( IRequest req ) : MetadataTypesConfig
req IRequest
return MetadataTypesConfig

HandleErrorResponse() public method

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

HasAccessToMetadata() public method

public HasAccessToMetadata ( IRequest httpReq, IResponse httpRes ) : bool
httpReq IRequest
httpRes IResponse
return bool

HasFeature() public method

public HasFeature ( Feature feature ) : bool
feature Feature
return bool

HasValidAuthSecret() public method

public HasValidAuthSecret ( IRequest httpReq ) : bool
httpReq IRequest
return bool

OnAfterExecute() public method

public OnAfterExecute ( IRequest req, object requestDto, object response ) : object
req IRequest
requestDto object
response object
return object

OnExceptionTypeFilter() public method

public OnExceptionTypeFilter ( Exception ex, ServiceStack.ResponseStatus responseStatus ) : void
ex System.Exception
responseStatus ServiceStack.ResponseStatus
return void

OnLogError() public method

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

OnSaveSession() public method

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

OnSessionFilter() public method

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
return IAuthSession

ResolveResponseException() public method

public ResolveResponseException ( Exception ex ) : Exception
ex System.Exception
return System.Exception

TryGetCurrentRequest() public method

public TryGetCurrentRequest ( ) : IRequest
return IRequest