notes from a passionate developer




This is a personal blog. The opinions expressed here represent my own and not those of my employer, nor current or previous. All content is published "as is", without warranty of any kind and I don't take any responsibility and can't be liable for any claims, damages or other liabilities that might be caused by the content.


MongoDB, C# and DateTime's

Storing DateTime in MongoDB using C# is easy. Just add a property of DateTime and off you go. Easy. Right? Well, MongoDB stores all date times as UTC, but you can tell the driver to deserialize back as e.g DateTimeKind.Local, but nevertheless, it will be stored in UTC (and maybe not returned with th…

Daniel Wertheim Daniel Wertheim

C# - Always valid value objects

Saw a video that was talking about the fact that using value objects provides you with always valid objects. Then it showed usage of the new'ish C# minimal construct for a record, using the positional syntax, defining some properties and then went on with life. This does of course not provide yo…

Daniel Wertheim Daniel Wertheim

Uri wonders...or not

It's not the first time the Uri gives me pain. This time I got a bug reported on one of my libraries where parts of the provided URL got replaced. A URL is defined as a two string parts which are then used to construct a URI. Now, I'm most certainly misusing it, or have been putting to much…

Daniel Wertheim Daniel Wertheim