public static void Main()
ShopperTicket shopperTicket = null;
if (IfCondition(shopperTicket))
Console.WriteLine("Entrou no IF");
Console.WriteLine("Não entrou no IF");
public static bool IfCondition(ShopperTicket shopperTicket) {
return !shopperTicket?.IsAuthenticated ?? false;
public class ShopperTicket {
public ShopperTicket(bool isAuthenticated) {
IsAuthenticated = isAuthenticated;
public bool IsAuthenticated { get; }