public static PropertyInfo GetProperty(Type type, string name) { return type.GetTypeInfo().DeclaredProperties.First(propertyInfo => propertyInfo.Name.Equals(name)); }