public async Task <IActionResult> Delete(int id) { var voucher = await _voucherRepository.GetById(id).ConfigureAwait(false); if (voucher == null) { return(NotFound($"No Voucher with Id '{id}' exists")); } await _voucherRepository.DeleteById(id).ConfigureAwait(false); return(Ok()); }