public static User Add(this DbSet<User> users, string userName, string email, string password, string displayName)
{
var now = DateTime.UtcNow;
var pwd = PasswordHash.Create(password);
return users.Add(new User
{
UserName = userName,
Email = email,
PasswordHash = pwd.Hash,
PasswordSalt = pwd.Salt,
DisplayName = displayName,
IsApproved = true,
CreatedDate = now,
LastLoginDate = now,
LastActivityDate = now
});
}