public async Task <IActionResult> DeleteSupplement(int id) { if (id <= 0) { return(BadRequest()); } var diet = await _supplementService.GetSupplementById(id); if (diet == null) { return(NotFound()); } await _supplementService.Delete(id); return(Ok()); }
public IActionResult SupplementDelete(Supplement supplement) { _supplementService.Delete(supplement); return(RedirectToAction("Index")); }