Example #1
0
        public int Update(IdentityRole role)
        {
            ConnectionService.ThreadVanityUrl = ConnectionName;

            AspNetRoles roleToUpdate = new AspNetRoles();

            SetConnection(roleToUpdate);
            roleToUpdate.AcceptChanges();

            roleToUpdate.Id   = role.Id;
            roleToUpdate.Name = role.Name;
            roleToUpdate.Save();

            return(1);
        }
Example #2
0
        /// <summary>
        /// Deltes a role from the Roles table
        /// </summary>
        /// <param name="roleId">The role Id</param>
        /// <returns></returns>
        public int Delete(string roleId)
        {
            try
            {
                ConnectionService.ThreadVanityUrl = ConnectionName;

                AspNetRoles role = new AspNetRoles();
                SetConnection(role);
                role.Id = roleId;
                role.AcceptChanges();
                role.MarkAsDeleted();
                role.Save();
            }
            catch { }

            return(1);
        }