Comments (10)
@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 :
from survip-webapi.
Bref, si ça marche pour l'onglet "Bâtiment", je pourrai compléter les requêtes manquantes.
from survip-webapi.
Et ça peut clairement attendre avant d'être fait.
from survip-webapi.
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.
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.
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.
Important :
Valider les appels de requêtes pour que la recherche de données soit accent et case insensitive.
from survip-webapi.
Ok, tous les calls sont maintenant là, tu peux switcher le tableau de bord à OData.
from survip-webapi.
J'ai mis le pull request à ton nom dans le webapi.
from survip-webapi.
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)
- Manage locationType for Coordinates in webAPI HOT 4
- Create a OData query to find children of a building
- Créer les nugets pour le DataLayer et l'authentification
- Gérer l'année du code d'utilisation dans l'API
- Wrong Model used for building Export to CAD
- Add Fields for Prevention to Cad export
- Enlever le tri par ssi dans la gestion des permissions HOT 1
- Add Child building post in webapi HOT 1
- Problem with inspection completion HOT 3
- Picture linked problem on inspection approval HOT 2
- Inspection approval: Can't add more than one picture to anomalies HOT 1
- Inspection approval: link with imported data is lost on approval
- created_on are not return within api for prevention export
- Filter prevention export list by building and not by inspection
- Site plan picture is not updated from the mobile on complete inspection
- Site plan picture is not updated from the mobile on complete inspection HOT 1
- Incorrect and missing fields for hazardous materials when generating reports
- Ajouter une validation de suppression de question si celle-ci est paramètrée comme question suivante
- Requête des inspections complétées prêtes à exportées incorrecte HOT 1
- Add cause.security.management to the api
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from survip-webapi.