public static User GetAnonymousUser() { User user = Repository<User>.FindOne(Expression.Eq("Email", "anon@anonymous")); if (user == null) { user = new User("Anonymous", "anon@anonymous", "DO_NOT_ALLOW_TO_LOGIN"); CreateUser(user); } return user; }
public static void CreateUser(User user) { user.Password = HashPassword(user.Password); Repository<User>.Save(user); }