Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinDockx committed Mar 2, 2015
1 parent 2d8a8b8 commit a5712e3
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/Marvin.JsonPatch/Helpers/PropertyHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,44 +191,6 @@ private static PropertyInfo GetPropertyInfo(object targetObject, string property
}


//public static bool CheckIfPropertyExists(object targetObject, string propertyPath)
//{
// try
// {

// var splitPath = propertyPath.Split('/');

// // skip the first one if it's empty
// var startIndex = (string.IsNullOrWhiteSpace(splitPath[0]) ? 1 : 0);

// for (int i = startIndex; i < splitPath.Length - 1; i++)
// {
// var propertyInfoToGet = GetPropertyInfo(targetObject, splitPath[i]
// , BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance);
// targetObject = propertyInfoToGet.GetValue(targetObject, null);
// }

// // for dynamic objects
// if (targetObject is IDynamicMetaObjectProvider)
// {
// var target = targetObject as IDynamicMetaObjectProvider;
// var propList = target.GetMetaObject(Expression.Constant(target)).GetDynamicMemberNames();
// return propList.Contains(splitPath.Last());
// }
// else
// {
// var propertyToCheck = targetObject.GetType().GetProperty(splitPath.Last(),
// BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance);

// return propertyToCheck != null;
// }

// }
// catch (Exception)
// {
// return false;
// }
//}

}
}

0 comments on commit a5712e3

Please sign in to comment.