public async Task <IActionResult> OnGet(int measurementKeyId) { MeasurementKey = await _measurementKeyData.GetById(measurementKeyId); if (MeasurementKey == null) { return(RedirectToPage("../Error")); } return(Page()); }
public async Task <IActionResult> OnGet(int?measurementKeyId) { if (measurementKeyId.HasValue) { MeasurementKey = await _measurementKeyData.GetById(measurementKeyId.Value); } else { MeasurementKey = new MeasurementKey(); } if (MeasurementKey == null) { RedirectToPage("../Error"); } return(Page()); }