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))); }
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))); }