ServiceExtensions
Assembly: ServiceStack.dll
Declaration
public static class ServiceExtensions
Fields
Log
Methods
Redirect(IServiceBase, String)
Declaration
public static IHttpResult Redirect(this IServiceBase service, string redirect)
Returns
ServiceStack.Web.IHttpResult
Parameters
Redirect(IServiceBase, String, String)
Declaration
public static IHttpResult Redirect(this IServiceBase service, string redirect, string message)
Returns
ServiceStack.Web.IHttpResult
Parameters
LocalRedirect(IServiceBase, String)
Declaration
public static IHttpResult LocalRedirect(this IServiceBase service, string redirect)
Returns
ServiceStack.Web.IHttpResult
Parameters
LocalRedirect(IServiceBase, String, String)
Declaration
public static IHttpResult LocalRedirect(this IServiceBase service, string redirect, string message)
Returns
ServiceStack.Web.IHttpResult
Parameters
AuthenticationRequired(IServiceBase)
Declaration
public static IHttpResult AuthenticationRequired(this IServiceBase service)
Returns
ServiceStack.Web.IHttpResult
Parameters
GetSessionId(IServiceBase)
Declaration
public static string GetSessionId(this IServiceBase service)
Returns
System.String
Parameters
GetCacheClient(IRequest)
Declaration
public static ICacheClient GetCacheClient(this IRequest request)
Returns
ServiceStack.Caching.ICacheClient
Parameters
GetCacheClientAsync(IRequest)
Declaration
public static ICacheClientAsync GetCacheClientAsync(this IRequest request)
Returns
ServiceStack.Caching.ICacheClientAsync
Parameters
GetMemoryCacheClient(IRequest)
Declaration
public static ICacheClient GetMemoryCacheClient(this IRequest request)
Returns
ServiceStack.Caching.ICacheClient
Parameters
SaveSession(IServiceBase, IAuthSession, Nullable<TimeSpan>)
Declaration
[Obsolete("Use SaveSessionAsync")]
public static void SaveSession(this IServiceBase service, IAuthSession session, TimeSpan? expiresIn = null)
Parameters
SaveSessionAsync(IServiceBase, IAuthSession, Nullable<TimeSpan>, CancellationToken)
Declaration
public static async Task SaveSessionAsync(this IServiceBase service, IAuthSession session, TimeSpan? expiresIn = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
RemoveSession(IServiceBase)
Declaration
public static void RemoveSession(this IServiceBase service)
Parameters
RemoveSessionAsync(IServiceBase, CancellationToken)
Declaration
public static Task RemoveSessionAsync(this IServiceBase service, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
RemoveSession(Service)
Declaration
public static void RemoveSession(this Service service)
Parameters
RemoveSessionAsync(Service, CancellationToken)
Declaration
public static Task RemoveSessionAsync(this Service service, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
CacheSet<T>(ICacheClient, String, T, Nullable<TimeSpan>)
Declaration
public static void CacheSet<T>(this ICacheClient cache, string key, T value, TimeSpan? expiresIn)
Parameters
Type Parameters
CacheSetAsync<T>(ICacheClientAsync, String, T, Nullable<TimeSpan>, CancellationToken)
Declaration
public static async Task CacheSetAsync<T>(this ICacheClientAsync cache, string key, T value, TimeSpan? expiresIn, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type Parameters
SaveSession(IRequest, IAuthSession, Nullable<TimeSpan>)
Declaration
[Obsolete("Use SaveSessionAsync")]
public static void SaveSession(this IRequest httpReq, IAuthSession session, TimeSpan? expiresIn = null)
Parameters
SaveSessionAsync(IRequest, IAuthSession, Nullable<TimeSpan>, CancellationToken)
Declaration
public static Task SaveSessionAsync(this IRequest httpReq, IAuthSession session, TimeSpan? expiresIn = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
RemoveSession(IRequest)
Declaration
public static void RemoveSession(this IRequest httpReq)
Parameters
RemoveSessionAsync(IRequest, CancellationToken)
Declaration
public static Task RemoveSessionAsync(this IRequest httpReq, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
RemoveSession(IRequest, String)
Declaration
public static void RemoveSession(this IRequest httpReq, string sessionId)
Parameters
RemoveSessionAsync(IRequest, String, CancellationToken)
Declaration
public static async Task RemoveSessionAsync(this IRequest httpReq, string sessionId, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
GetSession(IServiceBase, Boolean)
Declaration
public static IAuthSession GetSession(this IServiceBase service, bool reload = false)
Returns
ServiceStack.Auth.IAuthSession
Parameters
GetSessionAsync(IServiceBase, Boolean, CancellationToken)
Declaration
public static Task<IAuthSession> GetSessionAsync(this IServiceBase service, bool reload = false, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<ServiceStack.Auth.IAuthSession>
Parameters
SessionAs<TUserSession>(IRequest)
Declaration
public static TUserSession SessionAs<TUserSession>(this IRequest req)
Returns
<TUserSession>
Parameters
Type Parameters
SessionAsAsync<TUserSession>(IRequest, CancellationToken)
Declaration
public static async Task<TUserSession> SessionAsAsync<TUserSession>(this IRequest req, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TUserSession>>
Parameters
Type Parameters
IsAuthenticated(IRequest)
Declaration
[Obsolete("Use IsAuthenticatedAsync")]
public static bool IsAuthenticated(this IRequest req)
Returns
System.Boolean
Parameters
IsAuthenticatedAsync(IRequest)
Declaration
public static Task<bool> IsAuthenticatedAsync(this IRequest req)
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
AssertAuthenticatedSession(IRequest, Boolean)
Declaration
public static IAuthSession AssertAuthenticatedSession(this IRequest req, bool reload = false)
Returns
ServiceStack.Auth.IAuthSession
Parameters
AssertAuthenticatedSessionAsync(IRequest, Boolean, CancellationToken)
Declaration
public static async Task<IAuthSession> AssertAuthenticatedSessionAsync(this IRequest req, bool reload = false, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<ServiceStack.Auth.IAuthSession>
Parameters
GetSession(IRequest, Boolean)
Declaration
public static IAuthSession GetSession(this IRequest httpReq, bool reload = false)
Returns
ServiceStack.Auth.IAuthSession
Parameters
GetSessionAsync(IRequest, Boolean, CancellationToken)
Declaration
public static Task<IAuthSession> GetSessionAsync(this IRequest httpReq, bool reload = false, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<ServiceStack.Auth.IAuthSession>
Parameters
GetSessionTimeToLive(ICacheClient, String)
Declaration
public static TimeSpan? GetSessionTimeToLive(this ICacheClient cache, string sessionId)
Returns
System.Nullable<System.TimeSpan>
Parameters
GetSessionTimeToLiveAsync(ICacheClientAsync, String, CancellationToken)
Declaration
public static async Task<TimeSpan?> GetSessionTimeToLiveAsync(this ICacheClientAsync cache, string sessionId, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Nullable<System.TimeSpan>>
Parameters
GetSessionTimeToLive(IRequest)
Declaration
public static TimeSpan? GetSessionTimeToLive(this IRequest httpReq)
Returns
System.Nullable<System.TimeSpan>
Parameters
GetSessionTimeToLiveAsync(IRequest, CancellationToken)
Declaration
public static Task<TimeSpan?> GetSessionTimeToLiveAsync(this IRequest httpReq, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Nullable<System.TimeSpan>>
Parameters
RunAction<TService, TRequest>(TService, TRequest, Func<TService, TRequest, Object>, IRequest)
Declaration
public static object RunAction<TService, TRequest>(this TService service, TRequest request, Func<TService, TRequest, object> invokeAction, IRequest requestContext = null)
where TService : IService
Returns
System.Object
Parameters
Type | Name |
---|
<TService> | service |
<TRequest> | request |
System.Func<<TService>,<TRequest>,System.Object> | invokeAction |
ServiceStack.Web.IRequest | requestContext |
Type Parameters