Always pass serializer options to JSON serializer

Fixes: #664

This fixes an issue where we're not passing the serializer options to
the deserialize method for a user-specified payload. This was just an
oversight and did not behave as expected when users have customized the
settings.

(cherry picked from commit 710868c66e)
This commit is contained in:
Ryan Nowak 2021-04-30 13:54:23 -07:00
parent b1658657a5
commit da7b95838e
1 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ namespace Dapr.Actors.Client
await stream.FlushAsync();
var jsonPayload = Encoding.UTF8.GetString(stream.ToArray());
var response = await this.actorNonRemotingClient.InvokeActorMethodWithoutRemotingAsync(this.ActorType, this.ActorId.ToString(), method, jsonPayload, cancellationToken);
return await JsonSerializer.DeserializeAsync<TResponse>(response);
return await JsonSerializer.DeserializeAsync<TResponse>(response, JsonSerializerOptions);
}
/// <summary>
@ -144,7 +144,7 @@ namespace Dapr.Actors.Client
public async Task<TResponse> InvokeMethodAsync<TResponse>(string method, CancellationToken cancellationToken = default)
{
var response = await this.actorNonRemotingClient.InvokeActorMethodWithoutRemotingAsync(this.ActorType, this.ActorId.ToString(), method, null, cancellationToken);
return await JsonSerializer.DeserializeAsync<TResponse>(response);
return await JsonSerializer.DeserializeAsync<TResponse>(response, JsonSerializerOptions);
}
/// <summary>