示例#1
0
        public List <Users> ListarUsuarios()
        {
            BaseUsuariosEntities db           = new BaseUsuariosEntities();
            List <Users>         usuariosList = (from users in db.Users select users).ToList();

            return(usuariosList);
        }
示例#2
0
        public Users ListarUnUsuario()
        {
            BaseUsuariosEntities db = new BaseUsuariosEntities();
            Users usuario;

            usuario = (from users in db.Users select users).First();
            return(usuario);
        }
示例#3
0
 public bool TestConnection()
 {
     using (var db = new BaseUsuariosEntities())
     {
         DbConnection conn = db.Database.Connection;
         try
         {
             conn.Open();   // check the database connection
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }