using System.Collections;
using System.Collections.Generic;
public static void Main()
"Interested.Programming",
foreach(var path in paths) {
Console.WriteLine($"{path} : {PropertyExists(path, typeof(Information))}");
public static bool PropertyExists(string path, Type t)
if (string.IsNullOrEmpty(path))
var pp = path.Split('.');
if (int.TryParse(prop, out var result))
var propInfo = t.GetMember(prop)
.Where(p => p is PropertyInfo)
t = propInfo.PropertyType;
if (t.GetInterfaces().Contains(typeof(IEnumerable)) && t != typeof(string))
? t.GetGenericArguments()[0]
public class Information {
public string FirstName {get;set;}
public string LastName {get;set;}
public Interested Interested {get;set;}
public IEnumerable<Address> Addresses { get;set; }
public class Interested {
public bool Programming {get;set;}
public string Street {get;set;}