Open Closed

complex result in get method deserialized incorrect #3223


User avatar
0
mc86 created
  • ABP Framework version: v5.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

the result in swagger is like this. { "data": [ { "report": { "reportName": "54321", "fileName": "报表", "dtoName": "CP.ReportService.Reports.ReportWithNavigationPropertiesDto", "iAppServiceName": "CP.ReportService.Reports.IReportsAppService", "getMethodName": "GetDxReportsAsync", "pageName": "CP.ReportService.Blazor.Pages.ReportService.Reports", "moduleName": "CP.ReportService.Blazor.ReportServiceBlazorModule", "creatorOuId": "00000000-0000-0000-0000-000000000000", "moduleId": "6e9df9da-353f-f99a-1496-3a0319326f0d", "isDeleted": false, "deleterId": null, "deletionTime": null, "lastModificationTime": "2022-04-27T08:51:30.9189059", "lastModifierId": "011a204f-b914-e9c7-eaba-3a037a9d79ec", "creationTime": "2022-04-22T10:44:03.704465", "creatorId": "760fbf89-c292-8265-b846-3a01f3e5f77c", "extraProperties": {}, "concurrencyStamp": "4940f6a8b1844df6bb155b6e0ed7b007", "id": "b550a7c7-679d-35ed-f918-3a0361548bcc" }, "module": { "moduleName": "OA模块", "creatorOuId": "d7ae3bfe-c42e-0582-878f-3a0279b85e20", "isDeleted": false, "deleterId": null, "deletionTime": null, "lastModificationTime": null, "lastModifierId": null, "creationTime": "2022-04-08T10:34:08.6577346", "creatorId": "760fbf89-c292-8265-b846-3a01f3e5f77c", "extraProperties": {}, "concurrencyStamp": "7667d696451a478c8884a7c531d30209", "id": "6e9df9da-353f-f99a-1496-3a0319326f0d" } } ], "totalCount": -1, "groupCount": -1, "summary": null }

after deserialized it liked this.

ValueKind = Object : "{"report":{"reportName":"54321","fileName":"报表","dtoName":"CP.ReportService.Reports.ReportWithNavigationPropertiesDto","iAppServiceName":"CP.ReportService.Reports.IReportsAppService","getMethodName":"GetDxReportsAsync","pageName":"CP.ReportService.Blazor.Pages.ReportService.Reports","moduleName":"CP.ReportService.Blazor.ReportServiceBlazorModule","creatorOuId":"00000000-0000-0000-0000-000000000000","moduleId":"6e9df9da-353f-f99a-1496-3a0319326f0d","isDeleted":false,"deleterId":null,"deletionTime":null,"lastModificationTime":"2022-04-27T08:51:30.9189059","lastModifierId":"011a204f-b914-e9c7-eaba-3a037a9d79ec","creationTime":"2022-04-22T10:44:03.704465","creatorId":"760fbf89-c292-8265-b846-3a01f3e5f77c","extraProperties":{},"concurrencyStamp":"4940f6a8b1844df6bb155b6e0ed7b007","id":"b550a7c7-679d-35ed-f918-3a0361548bcc"},"module":{"moduleName":"OA模块","creatorOuId":"d7ae3bfe-c42e-0582-878f-3a0279b85e20","isDeleted":false,"deleterId":null,"deletionTime":null,"lastModificationTime":null,"lastModifierId":null,"creationTime":"2022-04-08T10:34:08.6577346","creatorId":"760fbf89-c292-8265-b846-3a01f3e5f77c","extraProperties":{},"concurrencyStamp":"7667d696451a478c8884a7c531d30209","id":"6e9df9da-353f-f99a-1496-3a0319326f0d"}}"

i don't need the "ValueKind = Object : {}"" how can i fix this.


1 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @mc86

    Your object type is ResponseModelLoadResult. Do you have any special serializer for that class.

    As I see that class is from DevExpress. You should consider mapping that data to a DTO and providing it over API.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38