示例#1
0
        public async Task <DeviceConfig> UpdateDevice(TcpDeviceEditViewModel model)
        {
            var device = await _modbusService.GetDeviceById(model.Id);

            device.Title = model.Title;
            device.Ip    = model.Ip;
            device.Port  = model.Port;

            return(device);
        }
示例#2
0
        public async Task <IActionResult> DeviceRemove(int id)
        {
            await _modbusService.Remove(await _modbusService.GetDeviceById(id));

            return(RedirectToAction(nameof(Index)));
        }