private bool TestIfPropExists(object obj, string property) { PropertyInfo propertyInfo = obj.GetType().GetProperty(property); return propertyInfo == null ? false : true; }