Esempio n. 1
0
        static IServiceCollection ConfigureImportOptions(this IServiceCollection services, IConfiguration config)
        {
            var rc = new REDCapImportOptions {
                Enabled = config.GetValue <bool>(Config.Import.REDCap.Enabled)
            };

            if (rc.Enabled)
            {
                rc.ApiURI    = config.GetValue <string>(Config.Import.REDCap.ApiURI);
                rc.BatchSize = config.GetValue <int>(Config.Import.REDCap.BatchSize);
            }

            services.Configure <REDCapImportOptions>(opts =>
            {
                opts.Enabled   = rc.Enabled;
                opts.ApiURI    = rc.ApiURI;
                opts.BatchSize = rc.BatchSize;
            });

            services.Configure <ImportOptions>(opts =>
            {
                opts.REDCap = rc;
            });

            return(services);
        }
Esempio n. 2
0
 public REDCapImportOptionsDTO(REDCapImportOptions redcapOptions)
 {
     ApiURI    = redcapOptions.ApiURI;
     BatchSize = redcapOptions.BatchSize;
     Enabled   = redcapOptions.Enabled;
 }