예제 #1
0
        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());
            }
        }
예제 #2
0
 //[Authorize]
 // DELETE: api/People/5
 public void Delete(int id)
 {
     _addressBookRepository.DeleteAddressBook(id);
 }