using System; public class Test { public bool Prop { get; set; } public static void Main() { Test obj = new Test(); // this is working but I can't have it on one line if (obj != null) { obj.Prop = true; } // this is not working // t?.Prop = true; } }