public override bool IsUserInRole(string username, string roleName)
 {
     using (var db = new ParqueMotorEntities())
     {
         try
         {
             var usuario = db.UsuarioSet.First(obj => obj.Login == username);
             return usuario.Rol.Nombre == roleName;
         }
         catch (Exception e)
         {
             return false;
         }
     }
 }
 public override string[] GetRolesForUser(string username)
 {
     using (var db = new ParqueMotorEntities())
     {
         try
         {
             var usuario = db.UsuarioSet.First(obj => obj.Login == username);
             return new[] {usuario.Rol.Nombre};
         }
         catch (Exception e)
         {
             return null;
         }
     }
 }
 public override bool ValidateUser(string username, string password)
 {
     using (var db = new ParqueMotorEntities())
     {
         var passcifrado = SeguridadUtilidades.GetSha1(password);
         return db.UsuarioSet.Any(o => o.Password == passcifrado && o.Login == username);
     }
 }
        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            using (var db = new ParqueMotorEntities())
            {
                var usuario = db.UsuarioSet.FirstOrDefault(o => o.Login == username);
                if (usuario == null)
                    return null;

                return new UsuarioMembership(usuario);
            }
        }