I'm getting my input data in camel and pascal case. before putting business logic I want to convert input data into a single case.
I did below code (it's working). It doesn't look good when I think about performance.
string message = "{JSON in pascal or camel case}";
var interimObject = JsonConvert.DeserializeObject<ExpandoObject>(message);
string json = JsonConvert.SerializeObject(interimObject, Formatting.Indented,new JsonSerializerSettings
{
ContractResolver = AppConfiguration.CamelCaseResolver
});
JObject alertMessage = JObject.Parse(json);
alertMessage.Add("id", Guid.NewGuid().ToString());//correlation-Id
Is there any better way??