public static FluxorOptions UsePersist(this FluxorOptions options, Action <PersistMiddlewareOptions> persistMiddlewareOptions = null) { var middlewareOptions = new PersistMiddlewareOptions(); persistMiddlewareOptions?.Invoke(middlewareOptions); options.AddMiddleware <PersistMiddleware>(); options.Services.AddScoped(_ => middlewareOptions); return(options); }
/// <summary> /// Creates a new instance of the middleware /// </summary> public PersistMiddleware(PersistMiddlewareOptions options, ILogger <PersistMiddleware> logger, IStoreHandler storeHandler) { Options = options; Logger = logger; StoreHandler = storeHandler; }
/// <summary> /// Creates a new instance of the middleware /// </summary> public PersistMiddleware(PersistMiddlewareOptions options, ILogger <PersistMiddleware> logger) { Options = options; Logger = logger; }