Category Archives: c#

Sitecore find Unused Sublayouts

Long lived Sitecore solutions tend to build up unused renderings and sublayouts as design, features and functions evolve. Finding those unused sublayouts it not just a matter of checking the Sitecore Link Database for sublayouts with no references because: You will … Continue reading

Posted in c#, General .NET, Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Leave a comment

SHA256 hashing email addresses for GDPR reasons

This is a followup on the previous post C# Mask email address for GDPR reasons, where user Inspector Cluedget pointed out that masking (replacing characters with *) an email address in the log file is the least safest of the data masking … Continue reading

Posted in .net, c#, General .NET | Tagged , , , , | 1 Comment

C# Mask email address for GDPR reasons

UPDATE 2018-08-10: See this post SHA256 hashing email addresses for GDPR reasons for an even better masking approcah. Thanks to Inspector Cluedget for the tip. This is a C# extension method that will mask your email address following this pattern: If it’s … Continue reading

Posted in .net, c#, General .NET | Tagged , , , | 3 Comments

Sitecore and WebApi

So you have some legacy WebApi code that needs to run in your Sitecore solution? Or are just just a WebApi expert and need to use your favorite tool in the toolbox? Fear not, WebApi will run fine in your … Continue reading

Posted in .net, c#, General .NET, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , | Leave a comment

Creating dynamic arrays and lists using Dynamic and ExpandoObject in C#

In this previous post, C# Using Newtonsoft and dynamic ExpandoObject to convert one Json to another, I described how you can use the dynamic keyword and the ExpandoObject class to quickly transform JSON without the need for any concrete implementations of … Continue reading

Posted in .net, c#, General .NET | Tagged , , , | Leave a comment

Azure Functions – How to retry messages in the poison queue

When working with a scenario where your Microsoft Azure Function reads data from a queue, your azure functions is automatically triggered when an entry is added to the queue you wish to read from. The SDK will call your function … Continue reading

Posted in c#, Microsoft Azure | Tagged , , | 2 Comments

Sitecore 9 Configuration not available on Dependency Injection – LockRecursionException: Recursive upgradeable lock acquisitions not allowed in this mode

Form Sitecore 8.2, Sitecore have implemented Dependency Injection for their own classes. Sitecore uses Microsoft’s Dependency Injection library. Sitecore uses dependency injection to inject many things, including configurations. Therefore, you cannot access configuration before after your code have been injected. … Continue reading

Posted in .net, c#, General .NET, Sitecore 8, Sitecore 9 | Tagged , , , | Leave a comment

In Sitecore 9, the ProxyDisabler have been retired completely

Sitecore have finally retired the ProxyDisabler in Sitecore 9. Proxy items were the early version of item cloning and were deprecated in Sitecore 6. And now the ProxyDisabler have been removed. There are no replacement. All you need to do … Continue reading

Posted in c#, General .NET, Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , | 1 Comment

Sitecore 9 Tracker.Current.Session.Identify is replaced with Tracker.Current.Session.IdentifyAs

In Sitecore 9, Sitecore have decided to change how you identify named users, i.e. how you match a Contact with a user that is logged into your website. The  Tracker.Current.Session.Identify method is obsolete. It has been replaced with Tracker.Current.Session.IdentifyAs: The IdentifyAs() … Continue reading

Posted in c#, General .NET, Sitecore 9 | Tagged , , , , , | 1 Comment

Sitecore Paging SOLR Responses

When querying Sitecore items from the SOLR index, you do not need to get all items in one go. In fact, the default SOLR implementation will stop at 5000 returned items, so for large queries, you need to use the … Continue reading

Posted in c#, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , | Leave a comment