C# ‘SHA256Managed’ is obsolete: ‘Derived cryptographic types are obsolete....
So my code gives me this warning: Warning SYSLIB0021 ‘SHA256Managed’ is obsolete: ‘Derived cryptographic types are obsolete. Use the Create method on the base type instead.’ The code that warns me...
View ArticleC# Application Insights Errors are Logged as Traces – How do I log them as...
So when I log to Application Insights, I first follow this guide to set up Application Insights AND File logging: C# Log to Application Insights and File from your .NET 6 Application To create a log...
View ArticleSitecore: Unable to load the service index for source...
Here is what you do if you receive messages like this: Errors in packages.config projectsUnable to find version ‘9.0.171219’ of package...
View ArticleSitecore: Insert Link tree does not expand
In my development Sitecore, I had this strange situation that when I tried to insert a link, the tree would not fold out for certain items: The content tree does not expand in the “insert link” dialog...
View ArticleC# Dapper convert numbers to 2 decimals
I had this problem when inserting numbers into a SQL database using Dapper. All of my numbers did not round correctly when being inserted, even when using Math.Round() before doing the insert. My...
View ArticleC# Dapper Async Bulk Inserts
In order for Dapper to do bulk inserts, you need a third-party library: Z.Dapper.Plus UPDATE 2023-12-08: Please note that Z.Dapper.Plus is a licensed product and you must pay to use it. For a solution...
View ArticleC# Inject ILogger into Dapper Polly Retry Policy
There are many articles describing how to make a retry policy when using Dapper. I especially like this extension method implementation. But you cannot inject any class into extension methods because...
View ArticleC# Convert array of objects into a DataTable
This extension method lets you convert an array of objects into a DataTable. DataTables are used for SQL inserts. This solution is not mine, in fact it has been copied so many times that I don’t know...
View ArticleC# SqlBulkCopy insert a list of objects
The SqlBulkCopy class is able to bulk insert data from anything that comes from a DataTable or can be read using a SqlDataReader. So what do you do if you have an array of objects? You have to convert...
View ArticleC# Connect to 2 or more databases using a Datacontext
This is more of a design pattern than it is a requirement. I use this technique when my application grows in size. When my application needs to connect to 2 or more databases, I use this encapsulation...
View Article
More Pages to Explore .....