Soft delete with Entity Framework

Soft delete with Entity Framework

In many of the applications we build, our users can delete items that are no longer needed. That's great because it gives them lots of autonomy. But sometimes the users aren't thinking hard enough (are they even thinking at all?) before deleting something they think they no longer needed. In that case they contact you and give you some weird reason why they deleted it and then the'll ask you to restore it. That's why I tend to always implement soft delete in my applications. In this post I'll show you how to implement Soft Delete without adding any complexity…

Read this article

Securing a WCF service with username and password

Securing a WCF service with username and password

In the .NET world, the use of WCF services is very common. There are lots of possible configurations available with these services and that's why we use them a lot! When it comes to securing these services I found that this is often overlooked. In this post I want to show you a really simple way of securing your services with a username and password. But if you prefer to use some other authentication mechanism you can also build upon this to implement your own.…

Read this article

Storing translations in a database: The right way!

Storing translations in a database: The right way!

When you are creating a website (or a webshop) targeting multiple countries and languages, you want to provide your visitors with localized content. For example in a webshop where you want to manage your products, some properties of the products are language invariant but others have to be translated. Because you keep all these products in a database you want to find an efficient way to store this information…

Read this article

Inheritance with Entity Framework

Inheritance with Entity Framework

When we are using Enitity Framework code first to define our model, chances are that we will probably want to use some inheritance here and there. Using migrations to create our database there, are different ways to define this inheritance in our database. I will show you the most commonly used ways of generating tables based on inherited classes.…

Read this article

MVC best practices for Create & Update

MVC best practices for Create & Update

In ASP.NET MVC you have lots of flexibility in writing your views, controllers and viewmodels. Anything is possible, which is great! But it also has a downside. Everyone finds there own way of doing things and when you are working in a team the codebase may become hard to maintain. I see many applications which have implemented the most basic operations such as Create and Update using 2 views and 2 viewmodels (sometimes 1 viewmodel if you are lucky). I think we can do better than that!…

Read this article

Custom routes in Umbraco for better SEO

Custom routes in Umbraco for better SEO

We all want lots of visitors on our sites, that's why we have to keep Google (and other search engines) happy when we are creating our site. To make our content more searchable we want to have the URL's to our pages as descriptive as possible. In this post I'll show you how to create custom routes in Umbraco that have the creation date and the name of the node in de URL (but you can use anything…

Read this article