public ActionResult <dasCommandsStructure> Put([FromBody] dasCommandsStructure newConfig) { SmartDASService service; try { service = new SmartDASService(); service.Connect(); } catch (Exception e) { return(StatusCode(500, e)); } try { service.setDASCommands(newConfig); } catch (Exception e) { service.Disconnect(); return(StatusCode(500, e)); } try { service.setDASCommands(newConfig); var dasCommands = service.getDASCommands(); service.Disconnect(); return(dasCommands); } catch (Exception e) { service.Disconnect(); return(StatusCode(500, e)); } }
public ActionResult <dasCommandsStructure> Get() { SmartDASService service; try { service = new SmartDASService(); service.Connect(); } catch (Exception e) { return(StatusCode(500, e)); } var dasCommands = new dasCommandsStructure(); try { dasCommands = service.getDASCommands(); } catch (Exception e) { return(StatusCode(500, e)); } service.Disconnect(); return(dasCommands); }