Someone mentioned to me to add something like this to this list:
using Newtonsoft.Json;
public static class MappingThroughSerialization
{
public static T Clone<T>(this object srcObject) where T : class
{
var destObject = JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(srcObject, JsonSettings.DefaultOptions_TypeNamePartial), JsonSettings.DefaultOptions_TypeNamePartial);
return destObject;
}
}
Basically, use serialization to map an object. I'm guessing that would be slower, but it would be interesting to add for comparison purposes.
Someone mentioned to me to add something like this to this list:
Basically, use serialization to map an object. I'm guessing that would be slower, but it would be interesting to add for comparison purposes.