Exemplo n.º 1
0
    public IActionResult Delete(int id)
    {
        var gram = grams.Get(id);

        if (gram != null)
        {
            return(NotFound());
        }

        grams.Delete(id);
        return(Ok());
    }
Exemplo n.º 2
0
        public async Task <IActionResult> OnPostDelete()
        {
            await _post.Delete(ID.Value);

            return(RedirectToPage("/Index"));
        }