public async Task OnGetAsync(int?Id) { if (Id != null) { RecipeToEdit = await _recipeController.GetRecipeByIdAsync((int)Id); RecipeToEdit.Steps = RecipeToEdit.Steps.OrderBy(x => x.StepNumber).ToList(); Measures = new SelectList(await _measureController.GetAllMeasuresAsync(), "Id", "Name"); Categories = new SelectList(await _categoryController.GetAllCategoriesAsync(), "Id", "Name"); } }