public static AsyncReply <IResource[]> Query(string path) { if (path == null || path == "") { var roots = stores.Where(s => s.Instance.Parents.Count == 0).ToArray(); return(new AsyncReply <IResource[]>(roots)); } else { var rt = new AsyncReply <IResource[]>(); Get(path).Then(x => { var p = path.Split('/'); if (x == null) { rt.Trigger(QureyIn(p, 0, stores)); } else { var ar = QureyIn(p, 0, stores).Where(r => r != x).ToList(); ar.Insert(0, x); rt.Trigger(ar.ToArray()); } }); return(rt); } }