コード例 #1
0
        public static IServiceCollection AddCloudFtpBridge(this IServiceCollection services, IConfiguration configuration, Action <CloudFtpBridgeAppBuilder> configureApp)
        {
            services
            .Configure <CoreOptions>(configuration.GetSection("CloudFtpBridge"))
            .AddSingleton <FileSystemActivator>()
            .AddSingleton <WorkflowRunner>();

            var builder = new CloudFtpBridgeAppBuilder(services);

            configureApp(builder);

            return(services);
        }
コード例 #2
0
        public static CloudFtpBridgeAppBuilder UseLiteDBStorage(this CloudFtpBridgeAppBuilder builder, Action <LiteDBOptions> configure = null)
        {
            Directory.CreateDirectory(PathHelper.GetDefaultStoragePath());

            configure = configure ?? new Action <LiteDBOptions>(o => { });

            builder.Configure(configure);

            builder
            .AddSingleton <IAuditLog, LiteDBAuditLog>()
            .AddSingleton <IWorkflowRepository, LiteDBWorkflowRepository>();

            return(builder);
        }
コード例 #3
0
        public static CloudFtpBridgeAppBuilder UseSmtpMailSender(this CloudFtpBridgeAppBuilder builder)
        {
            builder.AddTransient <IMailSender, SmtpMailSender>();

            return(builder);
        }
コード例 #4
0
        public static CloudFtpBridgeAppBuilder UseJsonMailSettingsProvider(this CloudFtpBridgeAppBuilder builder)
        {
            builder.AddSingleton <IMailSettingsProvider, JsonMailSettingsProvider>();

            return(builder);
        }
コード例 #5
0
        public static CloudFtpBridgeAppBuilder UseLocalFileSystem(this CloudFtpBridgeAppBuilder builder)
        {
            builder.AddTransient <LocalFileSystem>();

            return(builder);
        }
コード例 #6
0
        public static CloudFtpBridgeAppBuilder UseLiteDBLegacyStorage(this CloudFtpBridgeAppBuilder builder)
        {
            builder.AddSingleton <ILegacyDataProvider, LiteDBLegacyDataProvider>();

            return(builder);
        }