public Dictionary <IPath, IList <object> > SelectEnumerablesAsRelated(IList <IPath> paths, object data) { Dictionary <IPath, IList <object> > values; if (paths.Count > 0) { IInterrogator interrogator = InterrogatorFactory.CreateInteregator(data.GetType()); INavigator navigator = interrogator.CreateNavigator(data, paths[0].GetType()); if (navigator == null) { throw new Exception(string.Concat("Couldn't create a navigator for the path '", paths[0].ToString(), "'.")); } values = navigator.SelectEnumerablesAsRelated(paths); navigator.Dispose(); } else { values = new Dictionary <IPath, IList <object> >(); } return(values); }
public Dictionary <IPath, IList <object> > SelectEnumerablesAsRelated(IList <IPath> paths, object data) { Dictionary <IPath, IList <object> > values; if (paths.Count > 0) { var interrogator = InterrogatorFactory.CreateInteregator(data.GetType()); var navigator = interrogator.CreateNavigator(data, paths[0].GetType()); if (navigator == null) { throw new Exception(string.Format(ErrorResource.CouldntCreateNavigator, paths[0])); } values = navigator.SelectEnumerablesAsRelated(paths); navigator.Dispose(); } else { values = new Dictionary <IPath, IList <object> >(); } return(values); }
public IEnumerable <IPath> Map(object data) { var interrogator = InterrogatorFactory.CreateInteregator(data.GetType()); var mapper = interrogator.CreateMapper(data); if (mapper == null) { throw new Exception(string.Format(ErrorResource.CouldntCreateMapper, data)); } return(mapper.Map(data)); }
public IEnumerable <IPath> Map(object data) { IInterrogator interrogator = InterrogatorFactory.CreateInteregator(data.GetType()); IMapper mapper = interrogator.CreateMapper(data); if (mapper == null) { throw new Exception(string.Concat("Couldn't create a mapper for '", data.ToString(), "'.")); } return(mapper.Map(data)); }
public IEnumerable <object> SelectEnumerable(IPath path, object data) { var interrogator = InterrogatorFactory.CreateInteregator(data.GetType()); var navigator = interrogator.CreateNavigator(data, path.GetType()); if (navigator == null) { throw new Exception(string.Format(ErrorResource.CouldntCreateNavigator, path)); } var values = navigator.SelectEnumerable(path); navigator.Dispose(); return(values); }
public IEnumerable <object> SelectEnumerable(IPath path, object data) { IInterrogator interrogator = InterrogatorFactory.CreateInteregator(data.GetType()); INavigator navigator = interrogator.CreateNavigator(data, path.GetType()); if (navigator == null) { throw new Exception(string.Concat("Couldn't create a navigator for the path '", path.ToString(), "'.")); } IEnumerable <object> values = navigator.SelectEnumerable(path); navigator.Dispose(); return(values); }
public object SelectScalar(IPath path, object data) { IInterrogator interrogator = InterrogatorFactory.CreateInteregator(data.GetType()); INavigator navigator = interrogator.CreateNavigator(data, path.GetType()); if (navigator == null) { throw new Exception(string.Format(ErrorResource.CouldntCreateNavigator, path)); } object value = navigator.SelectScalar(path); navigator.Dispose(); return(value); }