コード例 #1
0
        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);
        }
コード例 #2
0
 /// <summary>
 /// Creates a new instance of the middleware
 /// </summary>
 public PersistMiddleware(PersistMiddlewareOptions options, ILogger <PersistMiddleware> logger, IStoreHandler storeHandler)
 {
     Options      = options;
     Logger       = logger;
     StoreHandler = storeHandler;
 }
コード例 #3
0
 /// <summary>
 /// Creates a new instance of the middleware
 /// </summary>
 public PersistMiddleware(PersistMiddlewareOptions options, ILogger <PersistMiddleware> logger)
 {
     Options = options;
     Logger  = logger;
 }