❔ NSwag and API help
I'm learning how to build an APIs and connect to it from a Blazor front-end. I'm using NSwag to build the http service client. I suppose this might be an NSwag question more than C#, but perhaps I'm just doing it completely wrong.
In my API, all my function calls are wrapped in a custom Result class:
So an example call in the API would be:
The problem is that NSwag flattens the call into one class:
How can I get NSwag to build the classes to be separated like they are in the API? My plan is to build generic functions in the front-end to depend on the Result class, with different logic based on the IsSuccess, Message, and Error properties.
Thank you for your help!
2 Replies