Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue found in Serialize method under the Utils class. #1

Open
DilipNikam opened this issue Jul 25, 2016 · 0 comments
Open

Issue found in Serialize method under the Utils class. #1

DilipNikam opened this issue Jul 25, 2016 · 0 comments

Comments

@DilipNikam
Copy link

DilipNikam commented Jul 25, 2016

I have user without core version of library. In my case I am using the template and my parameter dynamically send from my code. When I have used this utility found bug while Serialize the object. Below is the method is used in code

`using (var jsonWriter = new JsonTextWriter(writer))
{
serializer.Serialize(jsonWriter, objectToSerialize);
return jsonWriter.ToString();

//Console.WriteLine(writer.ToString());

}`
This method not created json string properly. So I have change the code as below.

`using (var jsonWriter = new JsonTextWriter(writer))
{
//serializer.Serialize(jsonWriter, objectToSerialize);
//return jsonWriter.ToString();

return JsonConvert.SerializeObject(objectToSerialize).ToString();
    //Console.WriteLine(writer.ToString());

}`

After that all is working fine. It will help some who uses the templates. Please comment is there any better option available that this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant