Exemplo n.º 1
0
 /// <summary>
 /// Updates UpdateDateTimeUtc and updateuserid to current, fills in createDateTimeUtc and CreatedBy if null
 /// </summary>
 public static void UpdateAuditFields(this AuditFieldsAllRequired record, UserProfile userProfile)
 {
     if (userProfile == null && record.CreatedBy == null && record.UpdatedBy == null)
     {
         throw new ApplicationException("User profile cannot be null for CreateUser/UpdateUser using AuditableFieldsAllRequired");
     }
     record.UpdateAuditFields(userProfile.UserProfileId);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sets defaults for the record (for new records)
 /// </summary>
 public static void SetDefaults(this AuditFieldsAllRequired record, UserProfile userProfile)
 {
     record.UpdateAuditFields(userProfile);
 }