private void TestNonNullWithProxy(int amount) { var student = new User { School = new School { District = new District { Street = new Street { Name = "Elm" } } } }; var s = "na"; for (int i = 0; i < amount; i++) { s += student.NeverNull().School.District.Street.Name.Final(); } Console.WriteLine(s.FirstOrDefault()); }
private void NullWithProxy(int amount) { var user = new User(); var s = "na"; for (int i = 0; i < amount; i++) { s += user.NeverNull().School.District.Street.Name.Final() ?? "na"; } Console.WriteLine(s.FirstOrDefault()); }