public static void TrackingPropertyCreate(this ISoftDeleteEntity entity, string createBy = null) { createBy = createBy ?? SecurityHelper.CurrentPrincipal.UserId.ToString(); entity.CreateBy = createBy; entity.UpdateBy = createBy; entity.CreateTime = entity.UpdateTime = DateTime.Now; entity.IsDelete = false; }
public static void UnDelete(this ISoftDeleteEntity entity) { entity.IsDeleted = false; if (!(entity is IDeletionTracking deletionTracking)) { return; } deletionTracking.DeletionDateTime = null; deletionTracking.DeleterUserId = null; deletionTracking.DeleterBrowserName = null; deletionTracking.DeleterIp = null; }
public static void TrackingPropertyUpdate(this ISoftDeleteEntity entity, string updateBy = null) { updateBy = updateBy ?? SecurityHelper.CurrentPrincipal.UserId.ToString(); entity.UpdateBy = updateBy; entity.UpdateTime = DateTime.Now; }
protected virtual void SoftDeleteCore(ISoftDeleteEntity entity) { entity.DeletedDate = GetSoftDeleteEntityDeletedDateValue(); }
public static bool IsNullOrDeleted(this ISoftDeleteEntity entity) { return(entity == null || entity.IsDeleted); }