public DeviceConfig GetDevice(TcpDeviceCreateViewModel model) { return(new DeviceConfig() { ChannelId = model.ChannelId, Title = model.Title, Type = model.Type, Ip = model.Ip, Port = model.Port }); }
public async Task <IActionResult> TcpDeviceCreate(TcpDeviceCreateViewModel model) { if (ModelState.IsValid) { await _modbusService.Create(_modbusFactory.GetDevice(model)); return(_getDefaultForm()); } return(PartialView("_TcpDeviceCreatePartial", model)); }