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

20 lines
775 B
C#
Raw Normal View History

2018-12-30 17:20:12 +00:00
using System.IO.Abstractions;
using Flowsharp.Persistence.FileSystem.Options;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
namespace Flowsharp.Persistence.FileSystem.Extensions
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddWorkflowsFileSystemPersistence(this IServiceCollection services, IConfiguration configuration)
{
services.TryAddSingleton<IFileSystem, System.IO.Abstractions.FileSystem>();
services.AddSingleton<IWorkflowStore, FileSystemWorkflowStore>();
services.Configure<FileSystemStoreOptions>(configuration);
return services;
}
}
}