Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 public IActionResult SupplementDelete(Supplement supplement)
 {
     _supplementService.Delete(supplement);
     return(RedirectToAction("Index"));
 }