public async Task <IActionResult> OnPostAsync() { Recipe.Id = Id.GetValueOrDefault(); await Rservice.SaveAsync(Recipe); return(RedirectToPage("/Recipe", new { id = Recipe.Id })); }
public async Task <IActionResult> OnPostDelete() { await Rservice.DeleteAsync(Id.Value); return(RedirectToPage("/Index")); }
} //expose recipe class public async Task OnGetAsync() { Recipe = Rservice.Find(Id.GetValueOrDefault()) ?? new Recipe(); }