Ejemplo n.º 1
0
 public override string[] GetAllRoles()
 {
     using (var usersContext = new ESTGestDbEntities2())
     {
         return usersContext.Roles.Select(r => r.RoleName).ToArray();
     }
 }
Ejemplo n.º 2
0
 public override bool IsUserInRole(string username, string roleName)
 {
     using (var usersContext = new ESTGestDbEntities2())
     {
         var user = usersContext.Users.SingleOrDefault(u => u.u_name == username);
         if (user == null)
             return false;
         return user.UserRoles != null && user.UserRoles.Select(u => u.Role).Any(r => r.RoleName == roleName);
     }
 }
Ejemplo n.º 3
0
 public override string[] GetRolesForUser(string username)
 {
     using (var usersContext = new ESTGestDbEntities2())
     {
         var user = usersContext.Users.SingleOrDefault(u => u.u_name == username);
         if (user == null)
             return new string[] { };
         return user.UserRoles == null ? new string[] { } : user.UserRoles.Select(u => u.Role).Select(u => u.RoleName).ToArray();
     }
 }
Ejemplo n.º 4
0
        public SQLMemberShipProvider()
        {
            _db = new ESTGestDbEntities2();

        }