public async Task <IActionResult> Edit(string deviceId, string functionName) { if (!await IsMyDevice(deviceId)) { return(NotFound()); } var function = await _deviceFunctionService.GetFunctionAsync(deviceId, functionName); return(View(function)); }
public async Task <IActionResult> GetFunction(string deviceId, string functionId) { var userDevice = await GetMyDevice(deviceId); if (userDevice == null) { return(NotFound()); // no matter if this device does not exist or you just don't have the access rights. Don't give a hint... } var result = await _deviceFunctionService.GetFunctionAsync(deviceId, functionId); return(Json(result.ToDeviceFunctionModel())); }
public async Task <DeviceFunctionModel> GetSingle(string deviceId, string functionId) { var result = await _deviceFunctionService.GetFunctionAsync(deviceId, functionId); return(result.ToDeviceFunctionModel()); }