Category Archives: General .NET

Issues related to general .NET and C# development

c# Async fire and forget

Often in application development you want a process to call another thread and continue the process flow, without waiting for a response from the called thread. This pattern is called the “fire and forget” pattern. I myself are oblivious to … Continue reading

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

Sitecore check access and roles programatically

The Sitecore security model have changed over time, but the general API to check security access and roles have been stable for many many years. CHECK IF USER HAS ACCESS TO AN ITEM: To check if a user have access … Continue reading

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

Solr delete document using UI and querystring

How do you delete a document from Solr? You can use query string parameters to do the delete: https://%5Bserver%5D:8983/solr/%5Bcore%5D/update?commit=true&stream.body=<delete><query>%5Bquery%5D</query></delete&gt; server: The name of your Solr server core: The name of the Solr core (the Solr index) to delete from query: … Continue reading

Posted in General .NET | Tagged | Leave a comment

Sitecore 9 Dependency Injection – Extend the Sitecore Logging

With the extended use of Dependency Injection (DI) in Sitecore 9, you have yet another tool to extend the Sitecore functionality. With DI you can basically replace or extend standard Sitecore functionality with your own code. Dependency Injection is not a … Continue reading

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

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

Sitecore from Rendering to Experience Editor

In Sitecore, how do you set up a template  and a rendering that works in the Experience editor? Here is the checklist: STEP 1: CREATE A TEMPLATE Create the template. For each field, use the “Title” field for all of … Continue reading

Posted in General .NET, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , , , , | 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 , , , , | 2 Comments

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