public override string[] GetRolesForUser(string username)
 {
     using (var db = new Concesionario20Entities())
     {
         var us = db.Usuario.First((o => o.Login == username));
         try
         {
             return new[] {us.Rol.NombreRol};
         }
         catch (Exception)
         {
             return null;
         }
     }
 }
        // nos devuelve si un usuario esta en el rol o no
        public override bool IsUserInRole(string username, string roleName)
        {
            using (var db= new Concesionario20Entities())
              {

              try
              {
                    var us = db.Usuario.First((o => o.Login == username));
                    return us.Rol.NombreRol == roleName;
              }
              catch (Exception)
              {
                  return false;
              }
              }
        }
 public override bool ValidateUser(string username, string password)
 {
     using (var db=new Concesionario20Entities())
     {
        var p = SeguridadUtilidades.GetSha1(password);
         return db.Usuario.Any(o => o.Password==p && o.Login==username);
     }
 }
        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            using (var db = new Concesionario20Entities())
            {
                var user = db.Usuario.FirstOrDefault(o => o.Login == username);
                if (user == null)
                {
                    return null;
                }

                return new UsuarioMemberShip(user);
            }
        }