示例#1
0
        internal IRelationMetadata GetMetadata(Schema schema, MetadataIdentity identity)
        {
            MetadataIdentity  parentIdentity = identity.Pop();
            IRelationMetadata parent         = schema.GetCachedMetadata <IRelationMetadata>(parentIdentity.Name) ?? this.GetMetadata(schema, parentIdentity);

            if (parent == null)
            {
                return(null);
            }
            else if (parent.Item != null && parent.Item.Identity.Equals(identity))
            {
                return(parent.Item);
            }

            return(parent.Properties.FirstOrDefault(m => m.Identity.Equals(identity)));
        }
示例#2
0
        private IRelationMetadata GetMetadata(IMetadataBuilderContext context, MetadataIdentity identity)
        {
            MetadataIdentity  parentIdentity = identity.Pop();
            IRelationMetadata parent         = context.GetMetadata <IRelationMetadata>(parentIdentity.Name) ?? this.GetMetadata(context, parentIdentity);

            if (parent == null)
            {
                return(null);
            }
            else if (parent.Item != null && parent.Item.Identity.Equals(identity))
            {
                return(parent.Item);
            }

            return(parent.Properties.FirstOrDefault(m => m.Identity.Equals(identity)));
        }