示例#1
0
        public void TestGetArchivedIem()
        {
            ItemSetUp();

            Assert.IsNotNull(DomainRepository <T> .GetArchived(ArchivedItem.ObjectId));

            Assert.IsNull(DomainRepository <T> .GetArchived(ActiveItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetArchived(ActiveDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetArchived(ArchivedDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetArchived(DraftDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetArchived(DraftItem.ObjectId));
        }
示例#2
0
        public void TestGetArchivedIemAfterUnDelete()
        {
            ItemSetUp();

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

            Assert.IsNotNull(DomainRepository <T> .GetArchived(ArchivedDeletedItem.ObjectId));
            Assert.IsNotNull(DomainRepository <T> .Get(ArchivedDeletedItem.ObjectId));
        }
示例#3
0
        public virtual T GetArchived(int id)
        {
            try
            {
                Authorize(Can_Read);
                return(DomainRepository <T> .GetArchived(id));
            }
            catch (System.Exception ex)
            {
                bool reThrow = ExceptionHandler.HandleBusinessLogicLayerException(ex);

                if (reThrow)
                {
                    throw;
                }

                return(null);
            }
        }