public async Task <IActionResult> Put(int id, [FromBody] Contact contact)
        {
            try
            {
                if (id != contact.Id)
                {
                    return(BadRequest());
                }
                await _contactBusinessLayer.UpdateContact(contact);

                return(NoContent());
            }
            catch (Exception ex)
            {
                _logger.LogError($"{ ex.Message } {(ex.InnerException != null ? ex.InnerException.Message : string.Empty)} {ex.StackTrace}");
                return(NoContent());
            }
        }
Esempio n. 2
0
 // PUT: api/Contacts/5
 public int Put(int id, [FromBody] Contact contact)
 {
     return(_objContactBusinessLayer.UpdateContact(contact));
 }