public T GetById(Guid contentId)
        {
            var conditionText = By.ContentId(contentId);
            var filter        = SqlTranslator.Build(conditionText, typeof(T));

            return(Orm.FindUnversionedContent <T>(filter).Result.Single());
        }
Beispiel #2
0
        private void SaveDraftChecksum(VersionedContentEntity item)
        {
            var contentType = item.GetType().GetCustomAttribute <TableAttribute>().TableName;

            var booleanExpression = By.ContentId(item.ContentId);
            var filter            = SqlTranslator.Build(booleanExpression, item.GetType());

            var currentPublishingData = Orm.FindUnversionedContent <ContentChecksum>(filter)
                                        .Result.SingleOrDefault();

            if (currentPublishingData == null)
            {
                currentPublishingData = new ContentChecksum
                {
                    ContentId   = item.ContentId,
                    Draft       = item.GetContentChecksum(),
                    ContentType = contentType
                };
                Orm.Save(currentPublishingData);
            }
        }