public IActionResult Delete(string id) { var hero = _heroService.Get(id); if (hero == null) { return(NotFound()); } _heroService.Remove(hero.Id); return(NoContent()); }
public async Task <IActionResult> Delete([FromRoute] string id) { var heroDb = await _heroService.Get(id); if (heroDb == null) { return(NotFound()); } await _heroService.Remove(heroDb); return(NoContent()); }