public async Task <IActionResult> UpdateAddressBook([FromBody] AddressBook addressBook) { if (ModelState.IsValid) { try { bool result = await _addressBookRepository.UpdateAddressBook(addressBook).ConfigureAwait(false); if (result) { CacheManager <List <AddressBook> > .Remove(_memoryCache, cacheKey); return(Ok(result)); } else { return(NotFound()); } } catch (Exception) { return(BadRequest()); } } return(BadRequest()); }
//[Authorize] // PUT: api/People/5 public void Put(int id, [FromBody] AddressBook addressBook) { _addressBookRepository.UpdateAddressBook(addressBook); }