Open Tegawende opened 7 years ago
Hi,
I had similar problem just few minutes ago (Dictonary as additional parameter value). The problem is that in ToString()
method of DataTablesResponse
class writes additional parameters like this: jsonWriter.WriteValue(keypair.Value);
I wanted to override this behavior, but DataTablesResponse
can not be inherited, because of private constructors..
So, I copied the DataTablesResponse
class implementation to my own DataTablesResponseExtended
class and use this code to write addidtional parameters:
foreach (var keypair in AdditionalParameters)
{
jsonWriter.WritePropertyName(keypair.Key, true);
if (keypair.Value is IEnumerable)
{
jsonWriter.WriteRawValue(SerializeData(keypair.Value));
}
else
{
jsonWriter.WriteValue(keypair.Value);
}
}
Hello,
I want to return additional parameters from my controllers. I enabled the response parameters according to what you said in other thread. My question is about the parser function. How can I write my parser function if I want to return a string array?
Sorry for my bad english. Thanks !