Arkobat
✅ Serializing a dictonary without path in root object
Hello, I'm trying to create a DTO for an API, where the request takes a dictornary of values, but the "keys" are part of the root object, and not under a path.
I'm therefor not sure how I can create a C# DTO, where the json output will like the example.
If I serilize the below, the language codes will be
languageMap.en
etc, which does not match the request object
Is there a solution on how to serilize the dictionary into the root object, without ot being under the path?2 replies
❔ Callback consumer to async Task
Hello
I'm trying to convert a callback based method to an async task.
The basic idea is I have a message bus where I can send messages.
Some of these messages require a response from the other end.
I can easily do this with a callback based system, but I would like to convert it to a
async/await
.
I have created this example (I know the code is invalid, it just serves as a sketch).
Is there a standardised way to do this? I have not been able to find it on stackoverflow.
7 replies
Replying with Rebus
I'm trying to develop an application, where services communicates via Rebus, with RabbitMQ is transporter.
I do however have some messages, I would like to reply to, e.g. retrieving X DTO.
However, I cannot find any documentation on how to reply in Rebus, so I'm wondering if this is even possible.
It should be possible in RabbitMQ, but I would love if it was something I could do directly with Rebus
Does anyone have any experience with this, that can help me the right way?
1 replies
Custom JSON serializer not working
Hello
I have a custom serializer i cannot get to work.
When I use the model in a controller, it just gives me null.
It is the following class I try to serialize
I want to be able to use the following input
This is my serializer.
Is should just take the string, and wrap it in a ExternalId
I have tried to put break points in here also, but they are never reached
And last, this is where I add my serializer
7 replies
Deserialize wrapper object in route
Hello.
Does anyone know if it is possible to map deserilize a custom wrapper object in a route?
IDs in my system is strings, and we have therefore made an
External
class.
The only point of this, is to improve code readability, to easy be able to view what is ids, and what is not.
We have made a serilizer, that maps maps the class to a string in any JSON schemes.
However, this serilizer does not seem to work, when we use the class in a route.
Can we do it via a serilizer or some middleware, or do I have to take a string as input, and map it to ExternalId
in my controller?
11 replies