The JsonServiceClient is using the best matching user-defined route if one exists and if you use Send it will use Primary Default Method, which since you only have āPATCHā on your single user-defined route it will use that. You can have your Request DTO implement IPost if you want it to use POST, otherwise you can explicitly send the Request DTO with client.Post()
Is the incomplete part youāre referring to the enum? By default the JSON Serializer doesnāt serialize default values but as the enum is nullable it should be be populated since the default value would be null instead of the default enum value.
Not sure why itās not getting populated, Is Verzenden the default value of the enum? If it is does is the Request DTO property populated with it? Does it work any other enum value?
Can you also enable Strict Mode to ensure all Serialization errors are thrown.
Env.StrictMode = true;
Can you also provide your AnalyseBatchStatusEnum enum and Iāll check if I can repro the serialization issue.
It however seems strange to me that the update caused it to revert to using de predefined route al of a sudden.
Iāve seent his happen too on another part of the application after this update, different class, wouldnt sent all properties either anymore, and also has reverted to using the predefined route.
The .NET Service Clients will use the best matching user-defined Route if one exists, which itās been doing for years, not sure when this behavior was added but v5.9.2 is a fairly old version.
You can force it to use the pre-defined routes by removing the user-defined [Route] attribute from the Request DTO or you could use a TypedUrlResolver, e.g:
var client = new JsonServiceClient(BaseUrl)
{
TypedUrlResolver = (client, method, request) => method is "POST" or "PATCH"
? client.SyncReplyBaseUri.CombineWith(request.GetType().Name)
: null
};
var response = client.Send(new PatchAnalyseBatch());
Iām unable to repro this issue. If you can upload a minimal stand-alone repro on GitHub that reproduces this Issue I can take a look.
Following some best practices, i made a change to server in the application pool in IIS.
Switching from .NET CLR Version v4.0.30319 to āNo Managed Codeā, as its a netcore api.
Then; the request comes through in full, as expected, both in the POST to the default endpoint, as the PATCH to de predefined route.