public async Task <ActionResult <Contact> > Get(int id) { try { var contact = await _contactBusinessLayer.GetContact(id); if (contact == null) { return(NotFound()); } return(contact); } catch (Exception ex) { _logger.LogError($"{ ex.Message } {(ex.InnerException != null ? ex.InnerException.Message : string.Empty)} {ex.StackTrace}"); return(NoContent()); } }
// GET: api/Contacts/5 public Contact Get(int id) { return(_objContactBusinessLayer.GetContact(id)); }