Ejemplo n.º 1
0
        /// <summary> Add specified user in a role </summary>
        public override void AddUserToRole(string userName, string roleName)
        {
            // TUser user = UserManager.FindByName(userName);
            TUser user = UserStore.FindUserByName(userName);

            if (user == null)
            {
                throw new ArgumentNullException(string.Format("Unknown user {0}", userName));
            }
            // UserManager.AddToRole(user.UserId, roleName);
            UserStore.AddUserToRole(user, roleName);
        }