public ActionResult <ItemResponse <int> > Add(ProviderDetailsAddRequest provider) { ObjectResult result = null; try { int userId = _auth.GetCurrentUserId(); int id = _service.Add(provider, userId); ItemResponse <int> response = new ItemResponse <int>() { Item = id }; result = Created201(response); } catch (Exception ex) { Logger.LogError(ex.ToString()); ErrorResponse response = new ErrorResponse(ex.Message); result = StatusCode(500, response); } return(result); }