ServiceController
Assembly: ServiceStack.dll
View Source
public class ServiceController : IServiceController, IServiceExecutor
Properties
RequestTypeFactoryMap
View Source
public Dictionary<Type, Func<IRequest, object>> RequestTypeFactoryMap { get; set; }
DefaultOperationsNamespace
View Source
public string DefaultOperationsNamespace { get; set; }
ResolveServicesFn
View Source
public Func<IEnumerable<Type>> ResolveServicesFn { get; set; }
Fields
RestPathMap
View Source
public readonly Dictionary<string, List<RestPath>> RestPathMap
Methods
Init()
View Source
public ServiceController Init()
Returns
ServiceStack.Host.ServiceController
RegisterServicesInAssembly(Assembly)
View Source
public void RegisterServicesInAssembly(Assembly assembly)
Parameters
Type | Name |
---|---|
System.Reflection.Assembly | assembly |
RegisterService(Type)
View Source
public void RegisterService(Type serviceType)
Parameters
Type | Name |
---|---|
System.Type | serviceType |
RegisterService(ITypeFactory, Type)
View Source
public void RegisterService(ITypeFactory serviceFactoryFn, Type serviceType)
Parameters
Type | Name |
---|---|
ServiceStack.Configuration.ITypeFactory | serviceFactoryFn |
System.Type | serviceType |
IsServiceType(Type)
View Source
public static bool IsServiceType(Type serviceType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | serviceType |
IsServiceAction(ActionMethod)
View Source
public static bool IsServiceAction(ActionMethod mi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Host.ActionMethod | mi |
IsServiceAction(String, Type)
View Source
public static bool IsServiceAction(string actionName, Type requestType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | actionName |
System.Type | requestType |
RegisterRestPaths(Type)
View Source
public void RegisterRestPaths(Type requestType)
Parameters
Type | Name |
---|---|
System.Type | requestType |
RegisterRestPath(RestPath)
View Source
public void RegisterRestPath(RestPath restPath)
Parameters
Type | Name |
---|---|
ServiceStack.Host.RestPath | restPath |
AfterInit()
View Source
public void AfterInit()
GetRestPathForRequest(String, String)
View Source
[Obsolete("Use GetRestPathForRequest(httpMethod, pathInfo, httpReq)")]
public IRestPath GetRestPathForRequest(string httpMethod, string pathInfo)
Returns
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String | pathInfo |
GetRestPathForRequest(String, String, IHttpRequest)
Get Best Matching Route.
View Source
public RestPath GetRestPathForRequest(string httpMethod, string pathInfo, IHttpRequest httpReq)
Returns
Parameters
Type | Name | Description |
---|---|---|
System.String | httpMethod |
|
| System.String
| pathInfo |
| | ServiceStack.Web.IHttpRequest | httpReq | If not null, ensures any Route matches any [Route(Matches)]
|
ResetServiceExecCachesIfNeeded(Type, Type)
View Source
public void ResetServiceExecCachesIfNeeded(Type serviceType, Type requestType)
Parameters
Type | Name |
---|---|
System.Type | serviceType |
System.Type | requestType |
RegisterServiceExecutor(Type, Type, ITypeFactory)
View Source
public void RegisterServiceExecutor(Type requestType, Type serviceType, ITypeFactory serviceFactoryFn)
Parameters
Type | Name |
---|---|
System.Type | requestType |
System.Type | serviceType |
ServiceStack.Configuration.ITypeFactory | serviceFactoryFn |
ApplyResponseFilters(Object, IRequest)
View Source
[Obsolete("Use ApplyResponseFiltersAsync")]
public object ApplyResponseFilters(object response, IRequest req)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | response |
ServiceStack.Web.IRequest | req |
ExecuteMessage(IMessage)
Execute MQ
View Source
public object ExecuteMessage(IMessage mqMessage)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Messaging.IMessage | mqMessage |
ExecuteMessageAsync(IMessage, CancellationToken)
Execute MQ
View Source
public Task<object> ExecuteMessageAsync(IMessage mqMessage, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.Messaging.IMessage | mqMessage |
System.Threading.CancellationToken | token |
ExecuteMessage(IMessage, IRequest)
Execute MQ with requestContext
View Source
public object ExecuteMessage(IMessage dto, IRequest req)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Messaging.IMessage | dto |
ServiceStack.Web.IRequest | req |
ExecuteMessageAsync(IMessage, IRequest, CancellationToken)
Execute MQ with requestContext
View Source
public async Task<object> ExecuteMessageAsync(IMessage dto, IRequest req, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.Messaging.IMessage | dto |
ServiceStack.Web.IRequest | req |
System.Threading.CancellationToken | token |
Execute(Object)
Execute using empty RequestContext
View Source
public object Execute(object requestDto)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | requestDto |
Execute(Object, IRequest)
Execute a Service with a Request DTO. See ExecuteAsync for a non-blocking alternative.
View Source
public virtual object Execute(object requestDto, IRequest req)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | requestDto |
ServiceStack.Web.IRequest | req |
ExecuteAsync(Object, IRequest)
Execute a Service with a Request DTO.
View Source
public virtual async Task<object> ExecuteAsync(object requestDto, IRequest req)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
ServiceStack.Web.IRequest | req |
Execute(Object, IRequest, Boolean)
View Source
public object Execute(object requestDto, IRequest req, bool applyFilters)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | requestDto |
ServiceStack.Web.IRequest | req |
System.Boolean | applyFilters |
Execute(IRequest, Boolean)
View Source
public object Execute(IRequest req, bool applyFilters)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Boolean | applyFilters |
ExecValidatorsAsync(Object, IRequest)
View Source
public async Task ExecValidatorsAsync(object request, IRequest req)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Object | request |
ServiceStack.Web.IRequest | req |
ManagedGatewayExecuteAsync(Object, IRequest)
Execute In Process Gateway Request with Gateway + Validation Filters
View Source
public async Task<object> ManagedGatewayExecuteAsync(object request, IRequest req)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
System.Object | request |
ServiceStack.Web.IRequest | req |
GatewayExecuteAsync(Object, IRequest, Boolean)
View Source
public async Task<object> GatewayExecuteAsync(object requestDto, IRequest req, bool applyFilters)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
System.Object | requestDto |
ServiceStack.Web.IRequest | req |
System.Boolean | applyFilters |
HasService(Type)
View Source
public bool HasService(Type requestType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | requestType |
GetService(Type)
View Source
public virtual ServiceExecFn GetService(Type requestType)
Returns
ServiceStack.Host.ServiceExecFn
Parameters
Type | Name |
---|---|
System.Type | requestType |
AssertServiceRestrictions(Type, RequestAttributes)
View Source
public void AssertServiceRestrictions(Type requestType, RequestAttributes actualAttributes)
Parameters
Type | Name |
---|---|
System.Type | requestType |
ServiceStack.RequestAttributes | actualAttributes |