public async Task <IActionResult> DeleteAddressBook(int addressId) { if (addressId == 0) { return(BadRequest()); } try { var success = await _addressBookRepository.DeleteAddressBook(addressId); if (success) { CacheManager <List <AddressBook> > .Remove(_memoryCache, cacheKey); return(Ok(success)); } else { return(NotFound()); } } catch (Exception) { return(BadRequest()); } }
//[Authorize] // DELETE: api/People/5 public void Delete(int id) { _addressBookRepository.DeleteAddressBook(id); }