Beispiel #1
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);
            }
        }
Beispiel #2
0
 protected virtual void SaveImpl(VersionedContentEntity item)
 {
     Orm.Save(item);
     SaveDraftChecksum(item);
 }