I have a question, we have an ASP.NET web app that can service multiple clients.
The only difference is that the app needs to convert some JSON string into a .NET object of type <T>
in order to pass that object to a WCF service.
For that purpose I am using Newtonsoft.Json.Converter:
T input = JsonConvert.DeserializeObject<T>(jsonInput);
The problem is that that type <T>
is unknown at design time.
But after the deserialization I need to have a generic strongly-typed object so that I can pass it to WCF service. The reason for that is WCF service is different for each client, and the parameter input may have a different structure for each client.
var client = new CalcEngine.CalculatorClient();
var input = new CalcEngine.CalcInputTypes();
var result = client.Calculate(input);
Here input is of type CalcEngine.CalcInputTypes. For clientA and clientB CalcEngine.CalcInputTypes may have different structure.
What is the best way to accomplish that?
Thanks.