private void ResetDeletedAudity(IDeleteAudit audit) { if (audit.IsNull()) { return; } audit.DeletedByUserId = null; audit.DeletedOnUtc = null; }
public virtual void PrepareForDeleteAudity(IDeleteAudit audit) { if (audit.IsNull()) { return; } Func <bool> deletedByUser = () => audit.DeletedByUserId.NotNull() && audit.DeletedByUserId.Value > 0; if (audit.DeletedOnUtc.NotNull() || deletedByUser()) { throw new InvalidOperationException("DeletedAudit already deleted."); } audit.DeletedOnUtc = DateTime.UtcNow; audit.DeletedByUserId = _workContext.CurrentUserId; SetBrowseData(audit as IAccessAudit); }
public static bool WasDeleted(this IDeleteAudit audit) { return(audit.DeletedOnUtc.NotNull()); }