public async virtual Task <IActionResult> InsertDevice( [FromBody] InsertDeviceDTO device) { try { var res = await _mediator.Send(new ParamInsertDevice(device)); return(StatusCode((int)res.StatusCode, res)); } catch (Exception ex) { return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message)); } }
public ParamInsertDevice(InsertDeviceDTO device) { Device = device; }