public static void Main()
Person p3 = new Person();
Console.WriteLine(!string.IsNullOrEmpty(p1.Name));
Console.WriteLine(!string.IsNullOrEmpty(p2.Name));
Console.WriteLine(!string.IsNullOrEmpty(p3.Name));
Console.WriteLine(p1.Name.HasValue());
Console.WriteLine(p2.Name.HasValue());
Console.WriteLine(p3.Name.HasValue());
public string Name { get;set;}
public static class ExtensionMethods
public static bool HasValue(this string s) => !string.IsNullOrEmpty(s);