Exemple #1
0
        public static ProfileUser GetOrCreate(this IProfileRepository repository, string username)
        {
            var user = repository.Get(username);

            if (user != null)
            {
                return(user);
            }

            user = new ProfileUser {
                Name = username
            };
            repository.Save(user);
            return(user);
        }
Exemple #2
0
 public void Save(ProfileUser user)
 {
     users[user.Name] = user;
 }