// GET: Devices/Delete/5 public async Task <IActionResult> Delete(int?id) { if (id == null) { return(NotFound()); } var model = mapper.Map <DeviceRemove>(await sqlService.GetDeviceAsync((int)id)); if (model == null) { return(NotFound()); } return(View(model)); }
public async Task <IViewComponentResult> InvokeAsync(int deviceId) { var device = await sqlService.GetDeviceAsync(deviceId); var model = new Status() { IsConnected = device.IsConnected }; return(View(model)); }
public async Task <IActionResult> GetAsync(int Id) { var viewModel = mapper.Map <DeviceIndex>(await sqlService.GetDeviceAsync(Id)); return(Ok(viewModel)); }