Exemplo n.º 1
0
        public Guid GetCollectionFromTimeline(Guid? timelineId)
        {
            if (timelineId == null)
            {
                return Guid.Empty;
            }

            IEnumerable<Guid> collectionGuid = new Guid[0];
            try
            {
                retryPolicy.ExecuteAction(
                  () =>
                  {
                      collectionGuid = Database.SqlQuery<Guid>("SELECT Collection_Id FROM Timelines WHERE Id = {0}", timelineId);
                  });
            }
            catch (Exception e)
            {
                throw e;
            }

            return collectionGuid.FirstOrDefault();
        }
Exemplo n.º 2
0
 public Guid GetCollectionFromContentItemGuid(Guid contentId)
 {
     IEnumerable<Guid> collectionGuid = new Guid[0];
     try
     {
         retryPolicy.ExecuteAction(
           () =>
           {
               collectionGuid = Database.SqlQuery<Guid>("SELECT Collection_Id FROM ContentItems WHERE Id = {0}", contentId);
           });
     }
     catch (Exception e)
     {
         throw e;
     }
     return collectionGuid.FirstOrDefault();
 }
Exemplo n.º 3
0
        public Guid GetCollectionGuid(string title)
        {
            IEnumerable<Guid> collectionGuid = new Guid[0];
            try
            {
                retryPolicy.ExecuteAction(
                  () =>
                  {
                      collectionGuid = Database.SqlQuery<Guid>("SELECT Id FROM Collections WHERE Title = {0}", title);
                  });
            }
            catch (Exception e)
            {
                throw e;
            }

            return collectionGuid.FirstOrDefault();
        }