예제 #1
0
        public static string DetermineCollectionType(RavenJObject metadata)
        {
            var id = metadata.IfPresent <string>("@id") ?? string.Empty;

            if (string.IsNullOrEmpty(id))
            {
                return("Projection");                // meaning that the document is a projection and not a 'real' document
            }
            if (id.StartsWith("Raven/"))
            {
                return("Sys Doc");
            }

            var entity = metadata.IfPresent <string>(Constants.RavenEntityName);

            return(entity ?? "Doc");
        }
예제 #2
0
        public static string DetermineCollectionType(RavenJObject metadata)
        {
            var id = metadata.IfPresent <string>("@id") ?? string.Empty;

            if (string.IsNullOrEmpty(id))
            {
                return(BuiltinCollectionName.Projection);                // meaning that the document is a projection and not a 'real' document
            }
            var entity = metadata.IfPresent <string>(Constants.RavenEntityName);

            if (entity != null)
            {
                entity = entity.ToLower();
            }
            return(entity ??
                   (id.StartsWith("Raven/")
                                        ? BuiltinCollectionName.System
                                        : BuiltinCollectionName.Document));
        }
예제 #3
0
		public static string DetermineCollectionType(RavenJObject metadata)
		{
			var id = metadata.IfPresent<string>("@id") ?? string.Empty;

			if (string.IsNullOrEmpty(id))
				return "Projection"; // meaning that the document is a projection and not a 'real' document

			if (id.StartsWith("Raven/"))
				return "Sys Doc";

			var entity = metadata.IfPresent<string>(Constants.RavenEntityName);
			if (entity != null)
				entity = entity.ToLower();
			return entity ?? "Doc";
		}