Example #1
0
        public void TestGetActiveItemAfterUnDelete()
        {
            ItemSetUp();

            With.Transaction(delegate
            {
                DomainRepository <T> .UnDelete(ActiveDeletedItem);
            });

            Assert.IsNotNull(DomainRepository <T> .GetActive(ActiveDeletedItem.ObjectId));
            Assert.IsNotNull(DomainRepository <T> .Get(ActiveDeletedItem.ObjectId));
        }
Example #2
0
        public void TestGetActiveItem()
        {
            ItemSetUp();

            Assert.IsNotNull(DomainRepository <T> .GetActive(ActiveItem.ObjectId));

            Assert.IsNull(DomainRepository <T> .GetActive(ArchivedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetActive(ActiveDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetActive(ArchivedDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetActive(DraftDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetActive(DraftItem.ObjectId));
        }
Example #3
0
        public virtual T GetActive(int id)
        {
            try
            {
                Authorize(Can_Read);
                return(DomainRepository <T> .GetActive(id));
            }
            catch (System.Exception ex)
            {
                bool reThrow = ExceptionHandler.HandleBusinessLogicLayerException(ex);

                if (reThrow)
                {
                    throw;
                }

                return(null);
            }
        }