Sakura.AspNetCore.Extensions/Sakura.AspNetCore.Messages/OperationMessageServiceCollectionExtensions.cs
/// <summary>
///     Add the operation message services to the specified service container.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection" /> to add the service to.</param>
/// <param name="configureOptions">A optional action for configure this service.</param>
/// <returns>The <paramref name="services" /> parameter.</returns>
/// <exception cref="ArgumentNullException"><paramref name="services" /> is <c>null</c>.</exception>
Add the operation message services to the specified service container.
Add the operation message services to the specified service container .
public static IServiceCollection AddOperationMessageAccessor([NotNull] this IServiceCollection services,
			[CanBeNull] Action<OperationMessageOptions> configureOptions = null)
		{
			if (services == null)
				throw new ArgumentNullException(nameof(services));
			services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
			services.TryAddScoped<IOperationMessageAccessor, DefaultOperationMessageAccessor>();
			if (configureOptions != null)
				services.Configure(configureOptions);
			return services;
		}
public static IServiceCollection AddOperationMessageAccessor ( [ NotNull ] this IServiceCollection services , [ CanBeNull ] Action < OperationMessageOptions > configureOptions = null ) { if ( services == null ) throw new ArgumentNullException ( nameof ( services ) ) ; services . TryAddSingleton < IHttpContextAccessor , HttpContextAccessor > ( ) ; services . TryAddScoped < IOperationMessageAccessor , DefaultOperationMessageAccessor > ( ) ; if ( configureOptions != null ) services . Configure ( configureOptions ) ; return services ; }
Add the operation message services to the specified service container.
Add the operation message services to the specified service container .
// Check argument // Try add service // Configure the service
None
None
this
[NotNull]
Action<OperationMessageOptions>
[CanBeNull]
services
The  to add the service to.
The to add the service to .
configureOptions
A optional action for configure this service.
A optional action for configure this service .