Wednesday, March 4, 2020

Deep Cloning

Had to debug an issue that turned out to be an issue deep cloning a complex object that had an IEnumerable list in it. The deep cloning would throw an Exception which was not very descriptive. 

The fix was to change the deep cloning and use json serialization.
You can see the first method is good but it caused the issue. The second fixed it and made he a happy coder.


#CSharp

Tuesday, February 25, 2020

Timezones on Linux and Windows 


When working on teams who run different development operating systems, tests might fail.
This happens when the tests is os dependent like timezones.
Example : setting the timezone string like this will not work on windows:

TimezoneString = "America/Los_Angeles"

The fix for this is:

This will allow the timezone to be set correctly for both Linux and Windows envionments.

I hope this helps :)