public ControllerStateHistory ActivateState(ISqLiteContext ctx, ControllerStateInformation controllerStateInformation, DateTime startTime) { var history = _entityFactory.CreateStateHistory(controllerStateInformation, startTime); ctx.Add(history); return(history); }
void InsertControllerState(ISqLiteContext ctx, Controller controller, IControllerState controllerState) { var stateModel = new ControllerStateInformation(); stateModel.State = controllerState.State; stateModel.PowerConsumption = controllerState.PowerConsumption; stateModel.Controller = controller; ctx.Add(stateModel); }
Controller InsertController(ISqLiteContext ctx, IMqttAdapter mqttAdapter) { var controller = _entityFactory.CreateController(); controller.Identifier = mqttAdapter.Identifier; controller.Type = mqttAdapter.Type; controller.InitializationArguments = _jsonSerializerService.Serialize(mqttAdapter.GetInitializationArguments()); ctx.Add(controller); return(controller); }