public static PathPropertyExpression FromPath(object obj, string path, bool bindOnValidation) { if (obj == null) throw new ArgumentNullException("obj"); if (path == null) throw new ArgumentNullException("path"); var pathParts = path.Split('.'); var propertyExpressionParts = new List<PropertyExpressionPart>(pathParts.Length); PathPropertyExpressionPart nextPart = null; for (var i = pathParts.Length - 1; i >= 0; --i) { var part = new PathPropertyExpressionPart(nextPart, pathParts[i], bindOnValidation); nextPart = part; propertyExpressionParts.Insert(0, part); } return new PathPropertyExpression(obj, propertyExpressionParts); }
public static PathPropertyExpression FromPath(object obj, string path, bool bindOnValidation) { if (obj == null) { throw new ArgumentNullException("obj"); } if (path == null) { throw new ArgumentNullException("path"); } var pathParts = path.Split('.'); var propertyExpressionParts = new List <PropertyExpressionPart>(pathParts.Length); PathPropertyExpressionPart nextPart = null; for (var i = pathParts.Length - 1; i >= 0; --i) { var part = new PathPropertyExpressionPart(nextPart, pathParts[i], bindOnValidation); nextPart = part; propertyExpressionParts.Insert(0, part); } return(new PathPropertyExpression(obj, propertyExpressionParts)); }
public PathPropertyExpressionPart(PathPropertyExpressionPart nextPart, string pathPart, bool bindOnValidation) : base(nextPart, bindOnValidation) { Debug.Assert(pathPart != null); _pathPart = pathPart; }
public PathPropertyExpressionPart(PathPropertyExpressionPart nextPart, string pathPart, bool bindOnValidation) : base(nextPart, bindOnValidation) { Debug.Assert(pathPart != null); _pathPart = pathPart; }