public ExcelExportController(
     UsageRecordsRepository repository,
     ExcelExportService excelExportService)
 {
     _repository         = repository;
     _excelExportService = excelExportService;
 }
 public UsageRecordsController(
     UsageRecordsRepository repository,
     IBus bus,
     IConfiguration configuration)
 {
     _repository    = repository;
     _configuration = configuration;
     _bus           = bus;
 }
 public DynamicQueryService(UsageRecordsRepository usageRecordsRepository)
 {
     _usageRecordsRepository = usageRecordsRepository;
     //_jsEngine.AddHostType("Console", typeof(Console));
     //_jsEngine.AddHostType(typeof(Enumerable));
     //_jsEngine.AddHostType(typeof(UsageRecord));
     //_jsEngine.AddHostObject("lib", new HostTypeCollection("mscorlib", "System.Core"
     //    ,"System.Collections","System.Runtime"));
 }
Пример #4
0
 public EquipmentHourlyRatesController(
     EquipmentHourlyRatesRepository repository,
     UsageRecordsRepository usageRecordsRepository,
     UsageRecordsRecycleBin usageRecordsRecycleBin
     )
 {
     _repository             = repository;
     _usageRecordsRepository = usageRecordsRepository;
     _usageRecordsRecyclBin  = usageRecordsRecycleBin;
 }
Пример #5
0
        public UsageRecordsController(
            UsageRecordsRepository usageRecordsRepository,
            UsageRecordsRecycleBin usageRecordsRecycleBin,
            DynamicQueryService dynamicQueryService,
            ExcelExportService excelExportService,
            ProjectsWebCacheService projectsWebCacheService,
            EquipmentHourlyRatesLocalCacheService equipmentHourlyRatesLocalCacheService,
            ElasticSearchInteropService elasticSearch
            )
        {
            _usageRecordsRepository  = usageRecordsRepository;
            _usageRecordsRecycleBin  = usageRecordsRecycleBin;
            _dynamicQueryService     = dynamicQueryService;
            _excelExportService      = excelExportService;
            _projectsWebCacheService = projectsWebCacheService;
            _equipmentHourlyRatesLocalCacheService = equipmentHourlyRatesLocalCacheService;

            _elasticSearch = elasticSearch;
        }
        public object QueryAsync(string code)
        {
            using IServiceScope scope = _serviceProvider.CreateScope();
            UsageRecordsRepository    repository   = scope.ServiceProvider.GetRequiredService <UsageRecordsRepository>();
            IEnumerable <UsageRecord> usageRecords = repository.UsageRecords.AsNoTracking();

            using Py.GILState gil = Py.GIL();
            using PyScope pyScope = Py.CreateScope();
            pyScope.Set(nameof(usageRecords), usageRecords.ToPython());
            PyObject pyObject = pyScope.Eval(code);

            if (pyObject.IsIterable())
            {
                return(pyObject.Select(item => item.AsManagedObject(typeof(object))));
            }
            else
            {
                object result = pyObject.AsManagedObject(typeof(object));
                return(result);
            }
        }
 public ProjectsController(
     UsageRecordsRepository repository)
 {
     _repository = repository;
 }
Пример #8
0
 public EquipmentHourlyRatesController(
     UsageRecordsRepository repository)
 {
     _repository = repository;
 }
Пример #9
0
 public DynamicQueryService(UsageRecordsRepository usageRecordsRepository)
 {
     _usageRecordsRepository = usageRecordsRepository;
 }