Пример #1
0
        static IServiceCollection ConfigureExportOptions(this IServiceCollection services, IConfiguration config)
        {
            var rc = new REDCapOptions {
                Enabled = config.GetValue <bool>(Config.Export.REDCap.Enabled)
            };

            if (rc.Enabled)
            {
                rc.ApiURI     = config.GetValue <string>(Config.Export.REDCap.ApiURI);
                rc.BatchSize  = config.GetValue <int>(Config.Export.REDCap.BatchSize);
                rc.RowLimit   = config.GetValue <int>(Config.Export.REDCap.RowLimit);
                rc.Scope      = config.GetValue <string>(Config.Export.REDCap.Scope);
                rc.SuperToken = config.GetByProxy(Config.Export.REDCap.SuperToken);
            }

            services.Configure <REDCapOptions>(opts =>
            {
                opts.Enabled    = rc.Enabled;
                opts.ApiURI     = rc.ApiURI;
                opts.BatchSize  = rc.BatchSize;
                opts.RowLimit   = rc.RowLimit;
                opts.Scope      = rc.Scope;
                opts.SuperToken = rc.SuperToken;
            });

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


            return(services);
        }
Пример #2
0
 public REDCapOptionsDTO(REDCapOptions redcapOptions)
 {
     ApiURI    = redcapOptions.ApiURI;
     Scope     = redcapOptions.Scope;
     BatchSize = redcapOptions.BatchSize;
     RowLimit  = redcapOptions.RowLimit;
     Enabled   = redcapOptions.Enabled;
 }
Пример #3
0
 public REDCapExportService(IOptions <ExportOptions> options, HttpClient client, ILogger <REDCapExportService> logger)
 {
     this.options = options.Value.REDCap;
     this.client  = client;
     this.logger  = logger;
 }
Пример #4
0
 public ExportOptionsDTO(ExportOptions exportOptions)
 {
     REDCap = new REDCapOptions(exportOptions.REDCap);
 }