Composition root in EPiServer

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...

Dependency injection in EPiServer

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...

Creating custom item level promotion

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...

Creating a simple coupon code discount

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...

Fixing InRiver multiple price import

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...

Registering multiple Dojo modules

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...

Enabling Commerce content selection

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...

Simple check if block is 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...

Translating EPiServer Category Description for EPiServer Find indexing

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...

EPiServer Marketing [Beta] - creating custom order promotion

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)...

Singleton page

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...

Scripting development environment

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...

Fixing Dojo id conflict

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...

Feature folders vs Tech folders

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 custom tab ordering

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 private ASP.NET and EPiServer configuration

Maintaining local development or private (secret) configuration in .NET always was hard. There is no single path how to do it. In this article, I am going to show one way how to solve these configuration issues...

Custom EPiServer Forms field

EPiServer recently released new add-on - EPiServer Forms. It is a new way how to work with the forms in EPiServer. Forms have different form elements available - Text (input), Text area, Number etc., but it misses basic label, heading and text elements to display static information for form users. Also, quite often there are requirements to provide additional information based on page's context - for example, on the product page, it might be required to post product code and name. This article describes basic steps to create custom EPiServer Forms field...

Getting started with Vim on Windows

I am not a new Vim user, but I have never used it as my main editor. I've learned the basic movement and editing commands, which I am using in Vi modes in different editors - Sublime Text's Vi mode, Visual Studio's extension - VsVim, and others. As now Vim can be used as fully featured C# (by Omnisharp) and F# (by vim-fsharp) environment, I want to use Vim as my main development environment. The first step for that is installing and setting up basic configuration...

Test DB reset with Respawn

When doing testing against DB it is important to reset it to initial state. I am using Entity Framework for SQL DB access and it provides mechanism to recreate DB each time, but it is slow and sometimes fails because of open DB connections. Much easier is to delete everything from tables and Respawn is great too which helps to do it...

Unobtrusive continuous testing with FAKE

When unit testing I want to get feedback from my tests fast - usually on build. The technique is called 'Continuous test-driven development' or just 'Continuous testing'. There are available several tools for it, but I wanted to try FAKE...

Using MassTransit to improve EPiServer data import on Azure

Azure has Service Bus service available, but while it is called 'Service Bus' it is messaging service as MSMQ or RabitMQ. Creating reliable message passing might be hard, but luckly there are several frameworks available. In this article I am going to describe how to use MassTransit's Service Bus framework with Azure Service Bus to improve EPiServer data import...

Creating WPF Metro style applications with MahApps.Metro

WPF gives you a lot of ways to style your Windows applications, but it might be hard to create beautiful application. I found open source project - MahApps.Metro which helps creating stylish WPF applications easily...

Handling child collections in Entity Framework

Configuring Entity Framework through fluent API sometimes is quite hard. In this article I am showing how to configure it to handle entity's child collections that those properly gets added and removed from collection...

EPiServer: strongly typed layout model without IPageViewModel

EPiServer provides Alloy sample which uses IPageViewModel<T> interface to provide strongly typed model for layout, but this approach has several issues. In this article I am going to show alternative way for strongly typed layout models...

F# Xaml - event driven MVVM

I have tried two different approaches to create Xaml application - MVC and MVVM, but did not feel that those are functional enough. In this article I am looking at event driven MVVM using FSharp.ViewModule's EventViewModelBase<'a>...

EPiServer: working with Scheduled Jobs programmatically

EPiServer provides Scheduled Jobs to run background tasks on schedule. By default those have simple scheduling available, but sometimes you might need more advanced scheduling techniques. EPiServer provides API for that...

F# Xaml application - MVVM vs MVC

Most popular approach for creating Xaml applications is MVVM - Model View ViewModel. But there is an alternative - MVC (Model View Controller). So what are advantages of using one or another in your F# projects?..

Azure infrastructure usage for EPiServer data import

I was working in EPiServer Commerce project on product import and thought that it would be great to use Azure infrastructure to make import process more reliable and consume less resources of Web server. In this article I am describing sample project using Azure Service Bus Queues and Worker Roles for this task...

EPiServer CMS site as Azure Web App

Lately Azure become really popular hosting you web applications and websites. EPiServer also has made their CMS able to run on Azure. In this article I am describing my experience to setup EPiServer CMS on Azure...

EPiServer: writing Dojo widget

I was working on open source library Geta Tags and wanted to improve editor user experience. Starting from EPiServer 7, EPiServer uses Dojo Toolkit for administrative interface. Searching for tutorials and articles on how to create Dojo widgets for EPiServer didn't get expected results. So I had to get through all the Dojo creation and configuration process through trial and errors. In this article I will try to describe how to create simple and more advanced Dojo widgets for EPiServer...

Installing JSDOM on Windows 8

I was starting to build JavaScript module which manipulates XML DOM. For testing purposes I needed some module which creates browser like document object model and the best module I found was JSDOM. Unfortunately installing it might be tricky...

DevConFu conference review

DevConFu is first DevClub conference in Latvia which was hold 13th – 15th November 2013 in Jurmala. Before conference I was sceptical about it. I was discovering conference program and found only few interesting sessions for me. Saw that there were many Agile, Testing, but less development related stuff. I also wanted to get to Mark Seeman's session "Poka-yoke code: APIs for stupid programmers", but was dissapointed that it didn't happen. And so I was even more sceptical. But...

Setting up RavenDB in EPiServer

I am using RavenDB in EPiServer for several months already. It is great replacement for DDS (Dynamic Data Store)...

Disposables, StructureMap and Web API Composition Root

In the last article I wrote how to create StructureMap composition root for Web API, but I mentioned that it will not work with dependences which are disposable. Solution for this issue is simple - use StructureMap's nested containers...

Better way to configure StructureMap in ASP.NET WebAPI

Few months ago Mark Seeman posted an article about why using Web API's IDependencyResolver is not appropriate. He suggests composing the dependency graph in IHttpControllerActivator because it provides context for composition...

Configuring StructureMap in ASP.NET WebAPI

Last week I started to work in project with WebAPI and first thing what I noticed was improper usage of StructureMap as IoC container. I googled for StructureMap configuration in WebAPI, but couldn't find good solution. But...