Skip to content

Instantly share code, notes, and snippets.

@vuamitom
Created September 1, 2014 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vuamitom/7ff861827f3040a9b5e2 to your computer and use it in GitHub Desktop.
Save vuamitom/7ff861827f3040a9b5e2 to your computer and use it in GitHub Desktop.
Servicestack store date in database as utc
public IUserAuth UpdateUserAuth(IUserAuth existingUser, IUserAuth newUser)
{
ValidateNewUser(newUser);
using (var db = dbFactory.Open())
{
AssertNoExistingUser(db, newUser, existingUser);
newUser.Id = existingUser.Id;
newUser.PasswordHash = existingUser.PasswordHash;
newUser.Salt = existingUser.Salt;
newUser.DigestHa1Hash = existingUser.DigestHa1Hash;
newUser.CreatedDate = existingUser.CreatedDate;
newUser.ModifiedDate = DateTime.UtcNow;
db.Save((TUserAuth)newUser);
return newUser;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment