public static void AddControllerUtils(this IServiceCollection services, IConfigurationRoot config) { services.AddSingleton((serviceProvider) => { var actioner = serviceProvider.GetService <BacktestJobActioner>(); return(new JobsControllerUtils(actioner)); }); services.AddSingleton((serviceProvider) => { var actioner = serviceProvider.GetService <BacktestJobGroupActioner>(); JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); AllTradesConnector allTradesConnector = serviceProvider.GetService <AllTradesConnector>(); TradeGenericMetric2SeriesConnector tradeGenericMetric2SeriesConnector = serviceProvider.GetService <TradeGenericMetric2SeriesConnector>(); UnrealizedPnlSeriesConnector unrealizedPnlSeriesConnector = serviceProvider.GetService <UnrealizedPnlSeriesConnector>(); return(new JobGroupsControllerUtils(actioner, jobsControllerUtils, allTradesConnector, tradeGenericMetric2SeriesConnector, unrealizedPnlSeriesConnector)); }); services.AddSingleton((serviceProvider) => { var actioner = serviceProvider.GetService <UnrealizedPnlSerieActioner>(); return(new UnrealizedPnlSeriesControllerUtils(actioner)); }); services.AddSingleton((serviceProvider) => { var actioner = serviceProvider.GetService <TradeGenericMetric2SerieActioner>(); return(new TradeGenericMetric2SeriesControllerUtils(actioner)); }); services.AddSingleton((serviceProvider) => { string stratFilesUploadDirectory = config.GetValue <string>("StratFileDropDir") ?? Path.GetTempPath(); JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); JobGroupsControllerUtils jobGroupsControllerUtils = serviceProvider.GetService <JobGroupsControllerUtils>(); return(new CreateJobControllerUtils(stratFilesUploadDirectory, jobsControllerUtils, jobGroupsControllerUtils)); }); services.AddSingleton((serviceProvider) => { CreateJobControllerUtils createJobControllerUtils = serviceProvider.GetService <CreateJobControllerUtils>(); string excelJobFilesUploadDirectory = config.GetValue <string>("ExcelJobFileDropDir") ?? Path.GetTempPath(); string stratFilesUploadDirectory = config.GetValue <string>("StratFileDropDir") ?? Path.GetTempPath(); return(new CreateJobExcelControllerUtils(createJobControllerUtils, excelJobFilesUploadDirectory, stratFilesUploadDirectory)); }); services.AddSingleton((serviceProvider) => { JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); return(new WorkersControllerUtils(jobsControllerUtils)); }); services.AddSingleton((serviceProvider) => { JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); return(new AlertsControllerUtils(jobsControllerUtils)); }); services.AddSingleton((serviceProvider) => { JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); return(new OrdersControllerUtils(jobsControllerUtils)); }); services.AddSingleton((serviceProvider) => { JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); return(new PositionsControllerUtils(jobsControllerUtils)); }); services.AddSingleton((serviceProvider) => { JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); JobGroupsControllerUtils jobGroupsControllerUtils = serviceProvider.GetService <JobGroupsControllerUtils>(); return(new TradesControllerUtils(jobsControllerUtils, jobGroupsControllerUtils)); }); services.AddSingleton((serviceProvider) => { JobsControllerUtils jobsControllerUtils = serviceProvider.GetService <JobsControllerUtils>(); return(new StatusesControllerUtils(jobsControllerUtils)); }); services.AddSingleton((serviceProvider) => { string serverName = config.GetValue <string>("ServerName") ?? "BacktesterServer"; return(new InfoControllerUtils(serverName, DateTimeOffset.Now)); }); }
public StratFileController(CreateJobControllerUtils utils) { this.utils = utils; }
public CreateJobController(CreateJobControllerUtils createJobControllerUtils, JobGroupsControllerUtils jobGroupsControllerUtils) { this.createJobControllerUtils = createJobControllerUtils; this.jobGroupsControllerUtils = jobGroupsControllerUtils; }
public CreateJobExcelControllerUtils(CreateJobControllerUtils createJobControllerUtils, string excelJobFilesUploadDirectory, string stratFilesUploadDirectory) { this.createJobControllerUtils = createJobControllerUtils; this.excelJobFilesUploadDirectory = excelJobFilesUploadDirectory; this.stratFilesUploadDirectory = stratFilesUploadDirectory; }