ASP.NET Core: Factory Pattern Dependency Injection
In my last post, I talked about an approach for creating custom dependencies based on incoming requests. This allowed me to inspect the incoming request before supplying a dependency into the ASP.NET...
View ArticleASP.NET Core: Custom Service Based on Request
Recently a .NET Liberty reader asked me an interesting question: is it possible to control the creation of a dependency based on the incoming request? In particular, he wanted to provide a different...
View ArticleMoq on .NET Core
Hold the phone: up until recently, I was under the impression that Moq – the most popular .NET mocking framework – was not supported on .NET Core (and thereby, ASP.NET Core). Before I get to my...
View ArticleDependency Scanning in ASP.NET 5 – Part 2
In my previous post on dependency scanning in ASP.NET 5, I showed how I put together a few pieces of code to have ASP.NET 5 scan my project for dependencies that were marked with a custom annotation...
View ArticleDependency Scanning in ASP.NET 5
One of the coolest new features of ASP.NET 5 is dependency injection baked right into the framework as a first class citizen. Dependency injection allows us to create reusable components and services...
View ArticleLogging ASP.NET 5 Requests using Middleware
Troubleshooting web application issues can be a tricky problem. In many cases, the app works as expected during development and testing, but exhibits some unexpected behavior out in the wild. The main...
View ArticleHow To Unit Test ASP.NET 5 MVC 6 ModelState
A common pattern in ASP.NET 5 (MVC 6) applications is to make use of validation attributes from the System.ComponentModel.DataAnnotations namespace in order to ensure incoming requests are valid. For...
View ArticleFast ASP.NET 5 Integration Testing with xUnit
In a previous post I showed how I setup some integration tests for a simple ASP.NET 5 Web API project by making use of the TestServer class from the Microsoft.AspNet.TestHost namespace. This allowed me...
View ArticleASP.NET 5 Scoped Dependencies
ASP.NET 5 provides a super powerful way for managing code dependencies: dependency injection built right into the framework. Rather than having to construct dependencies throughout my code base (for...
View ArticleASP.NET 5 Entry Point Overview
The new ASP.NET 5 framework makes use of powerful command line tools for targeting various .NET framework versions (dnvm), restoring and building packages (dnu), and for executing code (dnx). There is...
View ArticleASP.NET 5 Diagnostics: Runtime Info Page
The new ASP.NET 5 execution model is a bit of a complex beast. By making use of the .NET version manager (dnvm), we can actually change the currently active .NET framework that our application will...
View ArticleASP.NET 5 Web API Integration Testing
In my previous post I talked about how I was able to setup a basic ASP.NET 5 Web API that provides CRUD operations for an entity called Habit. I still haven’t settled on a specific database provider...
View ArticleASP.NET 5 Web API Unit Testing
I’m currently building a new ASP.NET 5 Web API using pure .NET Core (not the full .NET framework). Before I can call my job done, I need to test my code and prove to myself that it works as I expect it...
View Article