public static void AddStateHydrator(this IServiceCollection serviceCollection, Action <StateHydratorOptions> optionsCallback) { var options = new StateHydratorOptions(); optionsCallback(options); serviceCollection.AddSingleton(options); serviceCollection.AddScoped <StateHydrator>(); }
public StateHydrator(IServiceProvider serviceProvider, StateHydratorOptions options) { this.serviceProvider = serviceProvider; this.options = options; }