elsa-core/src/core/Elsa.Persistence.FileSystem/Extensions/ServiceCollectionExtensions.cs

20 lines
762 B
C#
Raw Normal View History

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>();
services.AddScoped<IWorkflowStore, FileSystemWorkflowStore>();
2018-12-30 17:20:12 +00:00
services.Configure<FileSystemStoreOptions>(configuration);
return services;
}
}
}