public new IHttpActionResult Post(PersonalRoute personalRoute) { return(personalRoute.PersonId.Equals(CurrentUser.Id) ? (IHttpActionResult)Ok(_routeService.Create(personalRoute)) : StatusCode(HttpStatusCode.Forbidden)); }
public new IActionResult Post([FromBody] PersonalRoute personalRoute) { try { return(personalRoute.PersonId.Equals(CurrentUser.Id) ? (IActionResult)Ok(_routeService.Create(personalRoute)) : StatusCode(StatusCodes.Status403Forbidden)); } catch (Exception e) { _logger.LogWarning(e, "Fail to save personal address"); return(StatusCode(StatusCodes.Status500InternalServerError)); } }