A list of my favorite C# examples using Reflection
This article contains a list of code lines, that use reflection to access data in classes. Reflection can be combined with Generics and even though some might think it can be hacky, I find that Reflection offers a tremendous advantage when dealing with monolithic application and you want to write reusable code, and you can not use object oriented concepts such as inheritance. Let’s start without further delay.
How to fix the When passing parameters by position, each parameter can only be referenced once Dapper error
I lately had to write some queries using Dapper which use a date, defined from the user, and check this date against two other from-to dates. In other words the query tries to find if a given date is inside the range of two other dates. When I tried to use the same date-parameter to Dapper, I was getting the following exception: When passing parameters by position, each parameter can only be referenced once.
Use the ISNULL function in MSSQL to define default values in your queries
When I work with SQL-Views and create complex SELECT statements that return data from multiple tables, I like to define default values in case a row contains columns with NULL as value. To do this I use the ISNULL function.
How to fix the "Unable to retrieve child resources. This request is not authorized to perform this operation" error on Azure Storage Explorer
If you use the Azure cloud for hosting your application, chances are that you are also using a Storage Account and you are accessing its content via the Azure Storage Explorer tool.
If you are all of the sudden get the Unable to retrieve child resources. This request is not authorized to perform this operation error, then a possible reason for that is that the IP you are using to connect to Azure is not yet white-listed