public async Task <IActionResult> ActiveReservation( [FromBody] ActiveReservationDto activeReservationDto ) { try { var handler = new JwtSecurityTokenHandler(); string authHeader = Request.Headers["Authorization"]; authHeader = authHeader.Replace("Bearer ", ""); var jsonToken = handler.ReadToken(authHeader); var tokenS = handler.ReadToken(authHeader) as JwtSecurityToken; var nameId = int.Parse(tokenS.Claims.First(claim => claim.Type == "nameid").Value); var reservation = await _reservationService.ActiveReservation(activeReservationDto); return(Ok(reservation)); } catch (Exception e) { return(HttpExceptionMapper.ToHttpActionResult(e)); } }