Sakura.AspNetCore.Extensions/Sakura.AspNetCore.Mvc.TempDataExtensions/ServiceCollectionExtensions.cs
/// <summary>
///     Set <see cref="EnhancedSessionStateTempDataProvider" /> as the default <see cref="ITempDataProvider" /> service
///     implementation.
/// </summary>
/// <param name="services">The service container to adding the service.</param>
/// <exception cref="ArgumentNullException"><paramref name="services" /> is <c>null</c>.</exception>
Set  as the default  service
implementation.
Set as the default service implementation .
[PublicAPI]
		public static IServiceCollection AddEnhancedTempData([NotNull] this IServiceCollection services)
		{
			if (services == null)
				throw new ArgumentNullException(nameof(services));
			services.TryAddSingleton<IObjectSerializer, JsonObjectSerializer>();
			services.Replace(new ServiceDescriptor(typeof(ITempDataProvider), typeof(EnhancedSessionStateTempDataProvider),
				ServiceLifetime.Singleton));
			return services;
		}
[ PublicAPI ] public static IServiceCollection AddEnhancedTempData ( [ NotNull ] this IServiceCollection services ) { if ( services == null ) throw new ArgumentNullException ( nameof ( services ) ) ; services . TryAddSingleton < IObjectSerializer , JsonObjectSerializer > ( ) ; services . Replace ( new ServiceDescriptor ( typeof ( ITempDataProvider ) , typeof ( EnhancedSessionStateTempDataProvider ) , ServiceLifetime . Singleton ) ) ; return services ; }
Set  as the default  service
implementation.
Set as the default service implementation .
// Argument check // Add the IObjectSerializer implementation // Replace default ITempDataProvider
None
this
[NotNull]
services
The service container to adding the service.
The service container to adding the service .