Ejemplo n.º 1
0
 public ScanRequestController(ISiteConfigurationService siteConfigurationService, SiemensDbContext context, IScanRequestService scanRequestService, ILogger <ScanRequestController> logger)
 {
     _siteConfigurationService = siteConfigurationService;
     _context            = context;
     _scanRequestService = scanRequestService;
     _logger             = logger;
 }
Ejemplo n.º 2
0
 public PropertyController(ISiteConfigurationService siteConfigurationService, SiemensDbContext context, IPropertyService propertyService, ILogger <PropertyController> logger)
 {
     _siteConfigurationService = siteConfigurationService;
     _context         = context;
     _propertyService = propertyService;
     _logger          = logger;
 }
        private async Task AddProperties(SiemensDbContext context, Guid id, string properties, string functionProperties)
        {
            var entry = context.SystemObjects.Find(id);

            entry.Attributes           = properties;
            entry.FunctionProperties   = functionProperties;
            context.Entry(entry).State = EntityState.Modified;
            await context.SaveChangesAsync();
        }
Ejemplo n.º 4
0
        private void UpdateScanRequestNoSave(SiemensDbContext context, ScanRequest request)
        {
            var entity        = ScanRequestEntity.MapFrom(request);
            var trackedEntity = context.ScanRequests.Local.FirstOrDefault(r => r.Id == entity.Id);

            if (trackedEntity != null)
            {
                context.Entry(trackedEntity).State = EntityState.Detached;
            }

            context.Entry(entity).State = EntityState.Modified;
        }
 public ScanRequestService(IMapper mapper, IServiceScopeFactory scope, ISystemObjectService systemObjectService, ISiteConfigurationService siteConfigurationService, IBackgroundTaskQueue taskQueue, IApplicationLifetime applicationLifetime, ILogger <ScanRequestService> logger, IHttpClientFactory httpClientFactory, IApiTokenProvider apiTokenProvider, IOptions <AppSettings> options, SiemensDbContext dbContext, IServiceProvider serviceProvider)
 {
     _mapper = mapper;
     _scope  = scope;
     _siteConfigurationService = siteConfigurationService;
     _systemObjectService      = systemObjectService;
     _logger            = logger;
     _httpClientFactory = httpClientFactory;
     _apiTokenProvider  = apiTokenProvider;
     _options           = options.Value;
     _dbContext         = dbContext;
     _serviceProvider   = serviceProvider;
     _taskQueue         = taskQueue;
     _cancellationToken = applicationLifetime.ApplicationStopping;
 }
        private async Task Create(SiemensDbContext context, SystemObjectEntity SystemObject)
        {
            var existing = context.SystemObjects.FirstOrDefault(x => x.SiteId == SystemObject.SiteId && x.ObjectId == SystemObject.ObjectId && x.Name == SystemObject.Name && x.Designation == SystemObject.Designation);

            if (existing != null)
            {
                SystemObject.Id = existing.Id;
                context.Entry(SystemObject).State = EntityState.Modified;
            }
            else
            {
                context.SystemObjects.Add(SystemObject);
            }
            await context.SaveChangesAsync();
        }
Ejemplo n.º 7
0
 public SiteConfigurationController(SiemensDbContext context, ISiteConfigurationService siteConfigurationService, ILogger <SiteConfigurationController> logger)
 {
     _context = context;
     _siteConfigurationService = siteConfigurationService;
     _logger = logger;
 }
Ejemplo n.º 8
0
 public SiteConfigurationService(SiemensDbContext dbContext, ILogger <ISiteConfigurationService> logger)
 {
     _dbContext = dbContext;
     _logger    = logger;
 }
 public SystemObjectService(IServiceScopeFactory scope, SiemensDbContext dbContext, ILogger <ISystemObjectService> logger)
 {
     _scope     = scope;
     _dbContext = dbContext;
     _logger    = logger;
 }
 public SystemObjectController(SiemensDbContext context, IScanRequestService scanRequestService, ILogger <SystemObjectController> logger)
 {
     _context            = context;
     _scanRequestService = scanRequestService;
     _logger             = logger;
 }
Ejemplo n.º 11
0
 public PropertyService(SiemensDbContext dbContext, ILogger <IPropertyService> logger)
 {
     _dbContext = dbContext;
     _logger    = logger;
 }