GithubHelp home page GithubHelp logo

Comments (10)

iamkinetic avatar iamkinetic commented on September 24, 2024

@mickjol
Avant de trop m'avancer là-dedans, j'aimerais que tu essaies ce que j'ai de fait.

J'ai refait la requête qui sort les bâtiments sans inspection avec OData. J'ai séparé l'adresse en deux champs (FullLaneName et FullCivicNumber). L'url temporaire est celui ci :

http://localhost:5555/api/Inspection/BuildingWithoutInspectionOData

Ça fonctionne bien dans mes tests, mais j'utilise Postman pour mes tests :

image.png

from survip-webapi.

iamkinetic avatar iamkinetic commented on September 24, 2024

Bref, si ça marche pour l'onglet "Bâtiment", je pourrai compléter les requêtes manquantes.

from survip-webapi.

iamkinetic avatar iamkinetic commented on September 24, 2024

Et ça peut clairement attendre avant d'être fait.

from survip-webapi.

mickjol avatar mickjol commented on September 24, 2024

En utilisant ton URL comme plus haut, ca fonctionne : /api/Inspection/BuildingWithoutInspectionOData?$filter=contains(tolower(fullLaneName),tolower('dionne'))&$orderby=fullCivicNumber

Par contre, j'ai fait le test dans l'application. Devexpress génère le URL suivant (mais ne fonctionne pas) :
/api/Inspection/BuildingWithoutInspectionOData?%24top=20&%24count=true

from survip-webapi.

mickjol avatar mickjol commented on September 24, 2024

La requête semble maintenant bien fonctionner.

Mais je ne reçoie plus l'object :

{
Data: [...],
TotalCount: 1700
}

Je dois continuer de recevoir le résultat de cette façon

from survip-webapi.

iamkinetic avatar iamkinetic commented on September 24, 2024

Ok, le standard OData est que lorsqu'on demande un count ($count=true), ça retourne l'object dans ce format :

{
"@odata.context": "http://localhost:5555/api/odata/$metadata#BuildingForDashboard",
"@odata.count": 14398,
"value": [
{
"Id": "0005fa81-2350-4d1d-ac38-6e918cb42a6d",
"IdRiskLevel": "dc964b02-389c-4b8d-9b5b-f7d7a6502d5b",
"FullLaneName": "2E AVENUE"
}]
}

Ça semble être supporté par DevExtreme selon ma rapide recherche (https://www.devexpress.com/Support/Center/Question/Details/T395481/response-body-for-count-request).

Le problème que tu avais est que l'URL original utilisait un controller Asp.net core standard avec le routing standard qui ne supportait pas au complet les requêtes odata. J'ai refait un controller OData avec un routing OData et avec celui-ci on reçoit la réponse attendue :

http://localhost:5555/api/odata/BuildingForDashboard?%24top=20&%24count=true

from survip-webapi.

philipperobertgh avatar philipperobertgh commented on September 24, 2024

Important :
Valider les appels de requêtes pour que la recherche de données soit accent et case insensitive.

from survip-webapi.

iamkinetic avatar iamkinetic commented on September 24, 2024

Ok, tous les calls sont maintenant là, tu peux switcher le tableau de bord à OData.

from survip-webapi.

iamkinetic avatar iamkinetic commented on September 24, 2024

J'ai mis le pull request à ton nom dans le webapi.

from survip-webapi.

iamkinetic avatar iamkinetic commented on September 24, 2024

J'ai fermé temporairement le pull request.

Peut-être que tu pourras starter de l'api de la branche #67 au lieu de la #68. La #67 est fait par dessus là #68 et elle contient des changements qu'il faudra faire anyway :

  • Colonne de coordinates en type Geography au lieu de string.

from survip-webapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.