public static ObjectMeta FromPath(object root, string rootName, IEnumerable<string> path) { var current = new ObjectMeta(root, rootName); foreach (var memberName in path) { var member = current.GetMember(memberName); if (member == null) { throw new Exception(string.Format("Unknown member '{0}'", memberName)); } current = member; } return current; }
public static ObjectMeta FromPath(object root, string rootName, IEnumerable <string> path) { var current = new ObjectMeta(root, rootName); foreach (var memberName in path) { var member = current.GetMember(memberName); if (member == null) { throw new Exception(string.Format("Unknown member '{0}'", memberName)); } current = member; } return(current); }