danielwertheim

danielwertheim


notes from a passionate developer

Tags


Disclaimer

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.

C#

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 hope to the smart people behind it. Look at the…

Daniel WertheimDaniel Wertheim

Some ways to tame magical strings in .NET and C#

We have all seen them. The strings lying around here and there in the code base. Some times at least exposed as constants in the class. But what else can you do? Well, you can have things like dedicated constant classes or key masters or value-objects or just allow the user to easily pick a value using a simple Func<,>. Before looki…

Daniel WertheimDaniel Wertheim

Generic method cache vs reflection

Today, I was looking around in the source code of a project on GitHub and noticed some reflection used to extract methods. The methods in turn were used to apply state to instances during aggregations and projectins. I found out that the access path to the code only were once per aggregate/projection type and that the reflected methods in…

Daniel WertheimDaniel Wertheim