mirror of https://github.com/dapr/dotnet-sdk.git
				
				
				
			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.
This commit is contained in:
		
							parent
							
								
									53a8f96c10
								
							
						
					
					
						commit
						710868c66e
					
				| 
						 | 
				
			
			@ -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>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue