can any body help me with this code. I have written this code in asp.net MVC c# but I don't know why I used ? in the if statement logic. I want to know what mean booking?.UserID ??
public async Task<IActionResult> Details(int id)
{
//get the user who already logged in
IdentityUser user = await
_userManagerService.FindByNameAsync(User.Identity.Name);
//get single package
Booking booking = _bookingDataService.GetSingle(b => b.BookingID
== id);
if ((booking?.UserID ?? "A") == (user?.Id ?? "B"))
{
//create vm
BookingDetailsViewModel vm = new BookingDetailsViewModel
{
BookingDate=booking.BookingDate,
Price=booking.Price,
Qty=booking.Qty
};
//pass to view
return View(vm);
}
else
{
return RedirectToAction("Index", "Customer");
}
}
}