public IHttpActionResult Delete(int?id) { IHttpActionResult result; if (id != null) { repository.Delete((int)id); result = Ok(); } else { result = StatusCode(HttpStatusCode.BadRequest); } return(result); }
public async Task <IActionResult> Handle(DeleteCoffeeCommand command, CancellationToken cancellationToken) { logger.LogInformation($"Deleting coffee with id: {command.CoffeeId}"); var coffee = await coffeeRepository.FindById(command.CoffeeId); if (coffee == null) { this.logger.LogWarning($"Cannot find coffee with id: {command.CoffeeId}"); return(NotFound()); } await coffeeRepository.Delete(coffee); logger.LogInformation($"Successfully deleted coffee with id: {command.CoffeeId}"); return(Ok(coffee)); }
public void Delete(CoffeeBll coffee) { coffeeRepository.Delete(coffee.Map()); }
public IActionResult Delete(int id) { _coffeeRepository.Delete(id); return Ok(); }
public Coffee DeleteCoffee(int id) { return(_coffeeRepo.Delete(id)); }
public IActionResult Delete(int id) { _coffeeRepository.Delete(id); return(NoContent()); }
public Coffee Delete(int id) { return(_coffeeRepository.Delete(id)); }
public async Task Delete(int id) { await _coffeeRepository.Delete(id); }