Ejemplo n.º 1
0
        void ICredentialStore.CreateUser(string username, string password, string[] roles, string email, bool verified)
        {
            UserContainer userContainer = GetUserContainer(true);
            RoleContainer roleContainer = GetRoleContainer(true);

            User user = new User
            {
                Name = username,
                Password = password,
                Email = email,
                Verified = verified
            };
            foreach (string role in roles)
                user.RolesInternal.Add(roleContainer.GetRole(role));
            user.AddTo(userContainer);

            Context.Persister.Save(user);
        }