public DateTime LastPublished(string[] schemaUris)
        {
            TcmUri schemaTcmUri = new TcmUri(schemaUris.First());

            PublicationCriteria publicationCriteria = new PublicationCriteria(schemaTcmUri.PublicationId);

            Criteria[] schemaCriterias = schemaUris
                                         .Select(uri => new ItemSchemaCriteria(new TcmUri(uri).ItemId))
                                         .ToArray();

            Criteria basedOnSchema = CriteriaFactory.Or(schemaCriterias);
            Criteria basedOnSchemaAndInPublication = CriteriaFactory.And(publicationCriteria, basedOnSchema);

            Query q = new Query(basedOnSchemaAndInPublication);

            SortParameter sortParameter = new SortParameter(SortParameter.ItemLastPublishedDate, SortParameter.Descending);

            q.AddSorting(sortParameter);
            q.AddLimitFilter(new LimitFilter(1));

            string[] foundUris = q.ExecuteQuery();

            if (foundUris.Length > 0)
            {
                using (Tridion.ContentDelivery.Meta.ComponentMetaFactory fac = new Tridion.ContentDelivery.Meta.ComponentMetaFactory(schemaTcmUri.PublicationId))
                {
                    Tridion.ContentDelivery.Meta.IComponentMeta meta = fac.GetMeta(foundUris[0]);
                    return(meta.LastPublicationDate);
                }
            }

            return(DateTime.MinValue);
        }
 public List <ContentDelivery.Meta.IComponentMeta> GetComponentMetas(string[] componentUris)
 {
     Com.Tridion.Util.TCMURI uri = new Com.Tridion.Util.TCMURI(componentUris.First());
     using (Tridion.ContentDelivery.Meta.ComponentMetaFactory fac = new Tridion.ContentDelivery.Meta.ComponentMetaFactory(uri.GetPublicationId()))
     {
         return(componentUris
                .Select(compUri => fac.GetMeta(compUri))
                .ToList());
     }
 }
        public DateTime LastPublished(string[] schemaUris)
        {
            TcmUri schemaTcmUri = new TcmUri(schemaUris.First());

            PublicationCriteria publicationCriteria = new PublicationCriteria(schemaTcmUri.PublicationId);

            Criteria[] schemaCriterias = schemaUris
                .Select(uri => new ItemSchemaCriteria(new TcmUri(uri).ItemId))
                .ToArray();

            Criteria basedOnSchema = CriteriaFactory.Or(schemaCriterias);
            Criteria basedOnSchemaAndInPublication = CriteriaFactory.And(publicationCriteria, basedOnSchema);

            Query q = new Query(basedOnSchemaAndInPublication);

            SortParameter sortParameter = new SortParameter(SortParameter.ItemLastPublishedDate, SortParameter.Descending);
            q.AddSorting(sortParameter);
            q.AddLimitFilter(new LimitFilter(1));

            string[] foundUris = q.ExecuteQuery();

            if (foundUris.Length > 0)
            {
                using (Tridion.ContentDelivery.Meta.ComponentMetaFactory fac = new Tridion.ContentDelivery.Meta.ComponentMetaFactory(schemaTcmUri.PublicationId))
                {
                    Tridion.ContentDelivery.Meta.IComponentMeta meta = fac.GetMeta(foundUris[0]);
                    return meta.LastPublicationDate;
                }
            }

            return DateTime.MinValue;
        }
 public List<ContentDelivery.Meta.IComponentMeta> GetComponentMetas(string[] componentUris)
 {
     Com.Tridion.Util.TCMURI uri = new Com.Tridion.Util.TCMURI(componentUris.First());
     using (Tridion.ContentDelivery.Meta.ComponentMetaFactory fac = new Tridion.ContentDelivery.Meta.ComponentMetaFactory(uri.GetPublicationId()))
     {
         return componentUris
             .Select(compUri => fac.GetMeta(compUri))
             .ToList();
     }
 }