public override void DeleteFileAttachment(FileAttachment attachment) { using (TransactionScope transaction = new TransactionScope(mConfiguration)) { FileAttachmentDataStore dataStore = new FileAttachmentDataStore(transaction); attachment.Deleted = true; dataStore.Update(attachment); transaction.Commit(); } }
public override void UpdateFileAttachment(FileAttachment attachment) { //Check attachment if (attachment != null) { Attachment.FileHelper.CheckFile(attachment, attachment.Article.Category.AttachExtensions, attachment.Article.Category.AttachMaxSize); } using (TransactionScope transaction = new TransactionScope(mConfiguration)) { FileAttachmentDataStore dataStore = new FileAttachmentDataStore(transaction); dataStore.Update(attachment); transaction.Commit(); } }