Class WolfClientServiceCollectionExtensions
Dependency Injection extensions for HostedWolfClient.
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Wolfringo.Hosting.dll
Syntax
public static class WolfClientServiceCollectionExtensions
Methods
| Improve this Doc View SourceAddWolfClient(IServiceCollection, Action<HostedWolfClientOptions>)
Adds Hosted Wolf Client to services as a hosted service, and all related services.
Declaration
public static IHostedWolfClientServiceBuilder AddWolfClient(this IServiceCollection services, Action<HostedWolfClientOptions> configureOptions = null)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | Service collection to add new services to. |
Action<HostedWolfClientOptions> | configureOptions | Configuration of client options. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
Remarks
This method will also add IWolfTokenProvider, IResponseTypeResolver, and ISerializerProvider<TKey, TSerializer> for messages and responses, unless already added.
Added client will be injectable as both HostedWolfClient and IWolfClient.
DisableAutoReconnect(IHostedWolfClientServiceBuilder)
Disables auto-reconnect behaviour.
Declaration
public static IHostedWolfClientServiceBuilder DisableAutoReconnect(this IHostedWolfClientServiceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceMapMessageSerializer(IHostedWolfClientServiceBuilder, String, IMessageSerializer)
Maps a message serializer in Message Serializer Provider.
Declaration
public static IHostedWolfClientServiceBuilder MapMessageSerializer(this IHostedWolfClientServiceBuilder builder, string eventName, IMessageSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
String | eventName | Name of WOLF protocol event. MessageEventNames for known constants. |
IMessageSerializer | serializer | Serializer to serialize and deserialize with. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceMapResponseSerializer(IHostedWolfClientServiceBuilder, Type, IResponseSerializer)
Maps a response serializer in Message Response Provider.
Declaration
public static IHostedWolfClientServiceBuilder MapResponseSerializer(this IHostedWolfClientServiceBuilder builder, Type responseType, IResponseSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
Type | responseType | Type of response message. |
IResponseSerializer | serializer | Serializer to serialize and deserialize with. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetAutoReconnect(IHostedWolfClientServiceBuilder, Int32, TimeSpan)
Sets auto-reconnect behaviour.
Declaration
public static IHostedWolfClientServiceBuilder SetAutoReconnect(this IHostedWolfClientServiceBuilder builder, int attempts, TimeSpan delay)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
Int32 | attempts | Max reconnect attempts. 0 to disable. Negative values to infinite. |
TimeSpan | delay | Delay between autoreconnect attempts. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetAutoReconnectAttempts(IHostedWolfClientServiceBuilder, Int32)
Sets max auto-reconnect attempts.
Declaration
public static IHostedWolfClientServiceBuilder SetAutoReconnectAttempts(this IHostedWolfClientServiceBuilder builder, int attempts)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
Int32 | attempts | Max reconnect attempts. 0 to disable. Negative values to infinite. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetAutoReconnectDelay(IHostedWolfClientServiceBuilder, TimeSpan)
Sets delay between auto-reconnect attempts.
Declaration
public static IHostedWolfClientServiceBuilder SetAutoReconnectDelay(this IHostedWolfClientServiceBuilder builder, TimeSpan delay)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
TimeSpan | delay | Delay between autoreconnect attempts. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetBetaServerURL(IHostedWolfClientServiceBuilder)
Sets server URL to Release Candidate server.
Declaration
public static IHostedWolfClientServiceBuilder SetBetaServerURL(this IHostedWolfClientServiceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetCredentials(IHostedWolfClientServiceBuilder, String, String, WolfLoginType)
Sets login credentials.
Declaration
public static IHostedWolfClientServiceBuilder SetCredentials(this IHostedWolfClientServiceBuilder builder, string login, string password, WolfLoginType loginType = WolfLoginType.Email)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
String | login | Login. |
String | password | Password. |
WolfLoginType | loginType | Login Type. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetDefaultServerURL(IHostedWolfClientServiceBuilder)
Sets server URL to Default.
Declaration
public static IHostedWolfClientServiceBuilder SetDefaultServerURL(this IHostedWolfClientServiceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetFallbackMessageSerializer(IHostedWolfClientServiceBuilder, IMessageSerializer)
Sets fallback message serializer in Message Serializer Provider.
Declaration
public static IHostedWolfClientServiceBuilder SetFallbackMessageSerializer(this IHostedWolfClientServiceBuilder builder, IMessageSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
IMessageSerializer | serializer | Message serializer to fall back to. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
SetFallbackResponseSerializer(IHostedWolfClientServiceBuilder, IResponseSerializer)
Sets fallback response serializer in Message Response Provider.
Declaration
public static IHostedWolfClientServiceBuilder SetFallbackResponseSerializer(this IHostedWolfClientServiceBuilder builder, IResponseSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
IResponseSerializer | serializer | Response serializer to fall back to. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
SetInfiniteAutoReconnectAttempts(IHostedWolfClientServiceBuilder)
Sets infinite auto-reconnect attempts.
Declaration
public static IHostedWolfClientServiceBuilder SetInfiniteAutoReconnectAttempts(this IHostedWolfClientServiceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |
See Also
| Improve this Doc View SourceSetServerURL(IHostedWolfClientServiceBuilder, String)
Sets server URL to connect to.
Declaration
public static IHostedWolfClientServiceBuilder SetServerURL(this IHostedWolfClientServiceBuilder builder, string url)
Parameters
Type | Name | Description |
---|---|---|
IHostedWolfClientServiceBuilder | builder | Hosted WOLF Client Service builder. |
String | url | URL of WOLF servers. |
Returns
Type | Description |
---|---|
IHostedWolfClientServiceBuilder |