summaryrefslogtreecommitdiffstats
path: root/projecttemplates/RelyingPartyLogic/Model.User.cs
diff options
context:
space:
mode:
Diffstat (limited to 'projecttemplates/RelyingPartyLogic/Model.User.cs')
-rw-r--r--projecttemplates/RelyingPartyLogic/Model.User.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/projecttemplates/RelyingPartyLogic/Model.User.cs b/projecttemplates/RelyingPartyLogic/Model.User.cs
index 16980e2..51fd38b 100644
--- a/projecttemplates/RelyingPartyLogic/Model.User.cs
+++ b/projecttemplates/RelyingPartyLogic/Model.User.cs
@@ -11,6 +11,19 @@ namespace RelyingPartyLogic {
using System.Web;
public partial class User {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="User"/> class.
+ /// </summary>
+ public User() {
+ this.CreatedOnUtc = DateTime.UtcNow;
+ }
+
+ partial void OnCreatedOnUtcChanging(DateTime value) {
+ if (value.Kind != DateTimeKind.Utc) {
+ throw new ArgumentException("DateTime must be given in UTC time.");
+ }
+ }
+
partial void OnEmailAddressChanged() {
// Whenever the email address is changed, we must reset its verified status.
this.EmailAddressVerified = false;