Пример #1
0
        public bool AddRole(int userId, int roleId)
        {
            string q = $"INSERT INTO UserRole (AppUserId , RoleId) VALUES({userId} , {roleId} )";

            using (CommanderBase commander = DBContext.CreateCommander())
            {
                var ur = commander.NonQuery(q);
                return(ur);
            }
        }
Пример #2
0
        public bool DeleteRole(int userId, int roleId)
        {
            string q = $"DELETE FROM UserRole WHERE AppUserId={userId} and RoleId={roleId}";

            using (CommanderBase commander = DBContext.CreateCommander())
            {
                var ur = commander.NonQuery(q);
                return(ur);
            }
        }