Introduction to Dependency Injection - Part 2

In the last post I gave an introduction to dependency injection, where I described what it is, how it can be achieved, and the motivation behind it. We left off by providing an example in an ASP.NET MVC controller, where we manually "newed up" dependencies inside the constructor of a controller. In this post we will take a look at dependency injection frameworks and see how they can help us manage dependencies.

Introduction to Dependency Injection - Part 1

The concept of dependency injection has been around for a long time. But now that dependency injection is baked into ASP.NET Core 1.0, I thought it would be a good time to write about what it is and why and how we can take advantage of it.

This post is part 1 of a two-part series on dependency injection. Click here to go to part two.

Creating Custom Filters in ASP.NET MVC

Whenever ASP.NET MVC receives an HTTP request, the request goes through code in the MVC framework before it reaches our controller actions. And then, after we return from our controller, it also goes through framework code before an HTTP response is emitted. The framework code that is involved is typically called the "pipeline". In this post we will talk about how we can insert our own custom code into the pipeline. This is achieved by creating special classes called filters.

Why I Don't Use the Repository Pattern When Working with Entity Framework

Today I'm going to talk about a slightly controversial topic about using the repository pattern in combination with an ORM such as Entity Framework.

Creating a Generic Lookup Service

In a previous post I talked about how we can manage lookup tables with Entity Framework Code First. In that post I suggested using the primary key directly to check for a specific lookup, rather than introducing an arbitrary column that will serve as an identifier. In this post I will talk about how we can make a generic lookup service to simplify how we show lookup values in, say, dropdown lists.

Managing Lookup Tables with Entity Framework Code First

Oftentimes in our applications we will have such things as a "lookup table". I am defining a lookup table as a list of relatively fixed or static choices such as status codes, states or provinces, and so on. In this post I will share how I manage lookup tables using Entity Framework.