public static void EnsureUser(this IRepository<User> repository, User user)
 {
     var existingUser = repository.GetBy(u => u.ClaimedIdentifier == user.ClaimedIdentifier);
     if (existingUser == null)
     {
         repository.Create(user);
     }
     else//update existing deets
     {
         existingUser.Email = user.Email;
         existingUser.FirstName = user.FirstName;
         existingUser.LastName = user.LastName;
         repository.Update(existingUser);
     }
 }
Пример #2
0
 public UserFlairModel(User user)
 {
     Id = user.Id;
     GravatarUrl = user.Email.GravitarUrlFromEmail();
     Name = String.Format("{0} {1}", user.FirstName, user.LastName);
 }