Extension methods are a great way to extend the functionality of objects. Sometimes, when extending an object, it is required to use some service and here comes a dependency injection. Developers use different approaches how to inject dependencies into an extension method. Some are better than others but some popular ones actually are anti-patterns.
In the previous article, I described different dependency injection aspects and how those are applied in EPiServer. This article shows how composition root can be created for EPiServer MVC controllers.
The concept of a dependency injection is simple - pass a dependent object in your object to use it. But that is not the only concept involved and some of the used concepts are better than others. In the EPiServer world, several patterns are used and misused.
Recently I had to configure read-only access to the Service API. ASP.NET Identity is used in this project and I was not able to make it work. The project was EPiServer 9 project. So I wanted to check if it is fixed in the EPiServer 10.
Some time ago I wrote an article how to create an order level promotion. In this article, I will describe how to create an item (entry) level promotion.
Coupon code discounts are one of the simplest discount types. All new EPiServer promotions can be configured to be applied with coupon code. In this article, I will show how to add a coupon code to an order and create a simple order discount using it.
In one EPiServer Commerce project, I needed to import multiple prices for a variation in different currencies from InRiver. InRiver has a connector for EPiServer but unfortunately it supports only one price per variation.
EPiServer recently released a package which adds support for ASP.NET identity in the CMS project. While it works great with CMS UI authentication, Service API configuration is a little bit more complicated.
EPiServer released Service API some time ago but it was missing an API for Customers, Carts and Order. We at have now released additional Service API endpoints for this Commerce functionality.
EPiServer provides a way how to initialize Dojo modules in the module.config file. Unfortunately, you can set only one module initializer. In this article, I will describe how to solve this issue.
As EPiServer Commerce nodes, products and variations are EPiServer content, it is possible to create properties with content references to these. But by default EPiServer do not allow commerce content selection in edit mode.
When working with EPiServer page views there is a useful property - PageEditing.PageIsInEditMode, which allows checking if the page is open in edit mode. But when working with block views, there is no such property.
I had a requirement when I needed to translate EPiServer Category Description within product content's property. While it did work fine when viewing the product's page, EPiServer Find did not index it properly - it was using default language's value for each language.
Last week I wrote an article about creating an order promotion with new EPiServer Marketing [Beta]. I haven't noticed the new version which came out last week and had some improvements in an API. This article describes changes in promotions for Commerce 9.16.0.
Lately, I had to build a custom order promotion in one of our projects in Geta. We are using latest EPiServer Marketing features but unfortunately as it is in Beta still, its API changes quite often. I had to re-build my custom promotion already twice. In this article, I will describe how to build a custom order promotion with the latest EPiServer Commerce version (9.15.0).
Quite often when developing a website on EPiServer, I am creating page types which are used only for a single page. Such pages could be - cart page, order page, password reset page etc. To load such page, the pattern I use is adding properties with content references of those pages on the start page, then load start page and then load configured page. This sounds too complicated when I know that this page has only a single instance. Also, it is quite often that I forget to configure these pages for different environments. So few months ago I had an idea to create extension methods which would allow loading these pages in a simple way.
I am not a mobile application developer but I needed to build an Android application. As for .NET developer, Xamarin Android was a natural choice.
Recently, I installed and configured my new development computer. Manual application installation and configuration take a lot of time. In the Linux (Ubuntu) world you can use apt-get to script application installation, but for configuration can backup dotfiles on the old machine and restore on the new. Luckily there are some tools which will help you do same on Windows.
Recently I had to setup Service API for one project and got some issues configuring it. Here are the list of those issues and solution to them.
Recently I got an error related to Dojo widget about conflicting id on the HTML element. While it is possible to work with Dojo without ids, those are necessary for field labels to work properly.
Recently I had to import data from one EPiServer site to another but got blank page immediately after clicking Begin Import button.
Convention based soft delete and created and modified date setting makes your code much simpler. Configuring Entity Framework to do it is a bit complicated, but possible.
For several years using ASP.NET MVC we tend to organize our code by Models, Controllers, and Views. In EPiServer development, we also split it more - into Page types, View models, and other types. But lately, developers started to realize that it is hard to manage such codebase and started to organize the code by features. In this article, I will analyze both approaches using Dependency Structure Matrix.
EPiServer allows us to group content's properties into different tabs using GroupName parameter on DisplayAttribute. While it works fine, it doesn't order tabs I want. In this article, I will show a simple declarative way to control tab ordering.
Maintaining local development or private (secret) configuration in .NET always was hard. There is no single path how to do it. Two days ago Scott Hanselman wrote an article about best practices for private config data. He describes existing way how to put configuration into an external file (which already existed since .NET 1.1 and 2.0 :) ), but there are still some open questions. In this article, I am going to show one way how to solve these configuration issues.