Implementing a basic Newtonsoft’s JsonConverter
I was deserializing an object that requires to be a string at the client but it's actually a structure inside the database, a person's name, saved as a Name { FirstName:'', LastName: '', ... } type of object. By using Newtonsoft's deserializer into a model such model can't just have a string Name as Newtonsoft's deserializer won't know how to parse the object into a simple string, so instead I had to declare the property as the same type of object that the name is saved into the database: PersonName. Now I wanted to transform it into a string when re-serializing it to send it to the client, which could do with a mapper but decided to try Newtonsoft's JsonSerializer attribute to see if it works and to my amazement…