public async Task <IActionResult> SerialChannelUpdate(SerialChannelEditViewModel model) { if (ModelState.IsValid) { await _modbusService.Update(await _modbusFactory.UpdateChannel(model)); return(_getDefaultForm()); } return(PartialView("_SerialChannelEditPartial", model)); }
public async Task <ChannelConfig> UpdateChannel(SerialChannelEditViewModel model) { var channel = await _modbusService.GetChannelById(model.Id); channel.Title = model.Title; channel.ComPort = model.ComPort; channel.Baudrate = model.Baudrate; channel.StopBits = model.StopBits; channel.Parity = model.Parity; return(channel); }