2018-12-30 17:20:12 +00:00
|
|
|
using System.IO.Abstractions;
|
2018-12-31 09:59:35 +00:00
|
|
|
using Elsa.Persistence.FileSystem.Options;
|
2018-12-30 17:20:12 +00:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
|
|
|
|
2018-12-31 09:59:35 +00:00
|
|
|
namespace Elsa.Persistence.FileSystem.Extensions
|
2018-12-30 17:20:12 +00:00
|
|
|
{
|
|
|
|
|
public static class ServiceCollectionExtensions
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection AddWorkflowsFileSystemPersistence(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
services.TryAddSingleton<IFileSystem, System.IO.Abstractions.FileSystem>();
|
2019-01-01 23:09:13 +00:00
|
|
|
services.AddScoped<IWorkflowStore, FileSystemWorkflowStore>();
|
2018-12-30 17:20:12 +00:00
|
|
|
services.Configure<FileSystemStoreOptions>(configuration);
|
|
|
|
|
|
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|