protected IList<PathSegment> GetParentPath(DocumentAndNavigationInfo info)
        {
            if (info.IsConflicted)
            {
                return new[]
                           {
                               new PathSegment {Name = "Documents", Url = "/documents"},
                               new PathSegment {Name = "Conflicts", Url = "/conflicts"}
                           };
            }

            if (info.Document == null)
            {
                return null;
            }

            var entityType = info.Document.Metadata.IfPresent<string>(Constants.RavenEntityName);

            if (entityType != null)
            {
                return new[]
                           {
                               new PathSegment {Name = "Documents", Url = "/documents"},
                               new PathSegment {Name = entityType, Url = "/collections?name=" + entityType}
                           };
            }

            return new[]
                       {
                           new PathSegment { Name = "Documents", Url = "/documents"}
                       };
        }
예제 #2
0
        protected IList <PathSegment> GetParentPath(DocumentAndNavigationInfo info)
        {
            if (info.IsConflicted)
            {
                return(new[]
                {
                    new PathSegment {
                        Name = "Documents", Url = "/documents"
                    },
                    new PathSegment {
                        Name = "Conflicts", Url = "/conflicts"
                    }
                });
            }

            if (info.Document == null)
            {
                return(null);
            }

            var entityType = info.Document.Metadata.IfPresent <string>(Constants.RavenEntityName);

            if (entityType != null)
            {
                return(new[]
                {
                    new PathSegment {
                        Name = "Documents", Url = "/documents"
                    },
                    new PathSegment {
                        Name = entityType, Url = "/collections?name=" + entityType
                    }
                });
            }

            return(new[]
            {
                new PathSegment {
                    Name = "Documents", Url = "/documents"
                }
            });
        }