public async Task <IActionResult> Cancel(int bookingId)
        {
            if (!int.TryParse(User.FindFirst(ClaimTypes.NameIdentifier)?.Value ?? string.Empty, out var _))
            {
                return(Unauthorized());
            }

            var privilages = new List <int>()
            {
                (int)UserPrivileges.Administrator, (int)UserPrivileges.Employee
            };

            int.TryParse(User.FindFirst(ClaimTypes.Role)?.Value, out var privilagesId);

            if (!privilages.Contains(privilagesId))
            {
                return(StatusCode((int)HttpStatusCode.Unauthorized));
            }

            var result = await _bookingRepository.Cancel(bookingId);

            return(result ? Ok() : StatusCode((int)HttpStatusCode.InternalServerError));
        }
 public IActionResult CancelBooking(int bookingid)
 {
     _log4net.Info(" Http CancelBooking request Initiated");
     if (bookingid == 0)
     {
         return(BadRequest("Provide Correct Input"));
     }
     try
     {
         var res = repo.Cancel(bookingid);
         if (res == 1)
         {
             return(Ok());
         }
         else
         {
             return(BadRequest("Could not be cancelled please try again"));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }