Example #1
0
        public bool TryExtractRelationships(IDictionary <Guid, IList <MediaItemAspect> > aspects, bool importOnly, out IList <RelationshipItem> extractedLinkedAspects)
        {
            string id;

            MockCore.ShowMediaAspects(aspects, MockCore.Library.GetManagedMediaItemAspectMetadata());
            if (MediaItemAspect.TryGetExternalAttribute(aspects, ExternalSource, ExternalType, out id) && ExternalId == id)
            {
                ServiceRegistration.Get <ILogger>().Debug("Matched {0} / {1} / {2} / {3} / {4}", Role, LinkedRole, ExternalSource, ExternalType, ExternalId);
                extractedLinkedAspects = new List <RelationshipItem>();
                foreach (IDictionary <Guid, IList <MediaItemAspect> > data in Data)
                {
                    extractedLinkedAspects.Add(new RelationshipItem(data, Guid.Empty));
                }
                return(true);
            }
            ServiceRegistration.Get <ILogger>().Debug("No match for {0} / {1} / {2} / {3} / {4}", Role, LinkedRole, ExternalSource, ExternalType, ExternalId);

            extractedLinkedAspects = null;
            return(false);
        }