Quantcast
Channel: Brian Pedersen's Sitecore and .NET Blog
Browsing all 285 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Sitecore ComputedIndexField extends your SOLR index

The Sitecore SOLR index is your quick access to Sitecore content. And you can extend this access by adding computed index fields. This is a way of enriching your searches with content that is not part...

View Article


Image may be NSFW.
Clik here to view.

C# Remove specific Querystring parameters from URL

These 2 extension methods will remove specific query string parameters from an URL in a safe manner. METHOD #1: SPECIFY THE PARAMETERS THAT SHOULD GO (NEGATIVE LIST): using System; using System.Linq;...

View Article


Image may be NSFW.
Clik here to view.

Sitecore KeepLockAfterSave – Configuring Security Policies Per-Role Based

Now here is a nifty Sitecore trick. You have probably learned about the AutomaticLockOnSave feature that allows Sitecore to lock an item when it is saved. The feature is enabled or disabled using...

View Article

Image may be NSFW.
Clik here to view.

C# Using Dapper as your SQL framework in .NET Core

Dapper is a easy to use object mapper for .NET and .NET Core, an it can be used a variety of ways. I use Dapper instead of Entity Framework because it makes my code less complex. BASICS OF DAPPER: THE...

View Article

Image may be NSFW.
Clik here to view.

.NET Core QueueMessage JSON to Typed Object. Using Azure.Storage.Queues

The documentation around .NET QueueMessage is a little fuzzy so depending on the version of your NuGet libraries might differ in properties. This article uses the Azure.Storage.Queues,...

View Article


Image may be NSFW.
Clik here to view.

Read from Azure Queue with .NET Core

The documentation around Azure Queues and .NET Core is a little fuzzy, as the approach have changed slightly over the last updates. Previously you had a shared Storage Account NuGet Package that gave...

View Article

Image may be NSFW.
Clik here to view.

Read and Write blob file from Microsoft Azure Storage with .NET Core

The documentation on the Azure Storage Blobs are a little fuzzy, as the NuGet packages and the approach have changed over time. The latest NuGet Package is now called: Azure.Storage.Blobs The concept...

View Article

Image may be NSFW.
Clik here to view.

C# Remove Duplicates from List with LINQ

C# LINQ do have a Distinct() method that works on simple types: // An string with non-unique elements string s = "a|b|c|d|a"; // Split the list and take the distinctive elements var distinctList =...

View Article


Image may be NSFW.
Clik here to view.

Create a custom Azure Dashboard Tile Using an Azure Function and Markdown Format

The tiles on an Azure Dashboard will only display data from Azure itself. So if you have data from the outside, like a database, you need to make a few workarounds. Tiles of an Azure Dashboard Now,...

View Article


Image may be NSFW.
Clik here to view.

HttpClient follow 302 redirects with .NET Core

The HttpClient in .NET Core will not automatically follow a 302 (or 301) redirect. You need to specify that you allow this. use the HttpClientHandler to do this: private static HttpClient _httpClient...

View Article

Image may be NSFW.
Clik here to view.

Sitecore read from Custom Database

It is very easy to read from a custom database in your Sitecore code. STEP 1: ADD THE CONNECTIONSTRING TO CONNECTIONSTRINGS.CONFIG This is an example of a .config file that transforms the connection...

View Article

Image may be NSFW.
Clik here to view.

Sitecore publishItem pipeline – handling missing delete when publishing

When publishing items in Sitecore, the publishItem pipeline is called for each item that must be published, or unpublished. Except for children of items that have been deleted. Let’s take this...

View Article

Image may be NSFW.
Clik here to view.

Write to SOLR from .NET Core

.NET Core supports the SOLR index through the SolrNet.Core NuGet packages. Here is how you update the index. STEP 1: THE NUGET PACKAGES You need the following NuGet packages:...

View Article


Image may be NSFW.
Clik here to view.

Why Sitecore Composable DXP is great news for developers and consultants

Sitecore announced that they will embrace the Composable DXP approach. DXP is, according to Gartner: A digital experience platform (DXP) is an integrated set of core technologies that support the...

View Article

Image may be NSFW.
Clik here to view.

C# Working with Namespaces in XDocument and XML

XDocument is your old XML friend in C#, and it allows you to create or manipulate XML documents. To work with namespaces, you must use the XNamespace class. This is an imaginary XML document (a Google...

View Article


Image may be NSFW.
Clik here to view.

Run parallel tasks in batches using .NET Core, C# and Async coding

If you have several tasks that you need to run, but each task takes up resources, it can be a good idea to run the tasks in batches. There are a few tools out there, and one of them is the...

View Article

Image may be NSFW.
Clik here to view.

Sitecore high CPU usage – is the SQL Session State Provider the villain?

My massive Sitecore 9.1 installation started having CPU spikes, even when the servers did not seem to receive more requests. When CPU spiked, I could see that the requests queue would build up, until...

View Article


Image may be NSFW.
Clik here to view.

C# and Microsoft.ML. Removing words from sentence. Getting started with...

Microsoft.ML is the NuGet package for ML.Net, Microsoft’s open-source Machine Learning framework. In this introduction I will create a stopword engine, capable of removing unwanted words from a...

View Article

Image may be NSFW.
Clik here to view.

Sitecore poor Index Update performance linked to missing Index in the Links...

Suddenly my index updates took forever to finish. I mean, one index update would take 2 minutes. And I have a lot of index updates. A lot. Index Updates in Sitecore After some panic and some SQL...

View Article

Image may be NSFW.
Clik here to view.

Sitecore create custom Content Editor Warnings using Conditions and Rules

The Content Editor Warnings are these yellow boxes that hover over your content in the Content Editor in Sitecore: Content Editor Warning In the old days we would make them by hooking into the...

View Article
Browsing all 285 articles
Browse latest View live