Jack Histon's Blog

Welcome to my blog !


ASP.NET Core 2.0 - Repository Overview: Action Selection

Published at September 9, 2017 ·  10 min read

Previously in this Series ASP.NET Core MVC - Repository Overview: Model Binding ASP.NET MVC Core - Repository Overview: Value Providers ASP.NET Core 2.0 - Repository Overview: Action Discovery Contents Introduction The ActionSelector Class Dependencies The Route Value Cache Conventional Routing A Note on Cache Efficiency Attribute Routing Attribute Routing with Route Templates Selecting the Best Candidate Evaluating the Constraints Summary Introduction This article is the fourth in a series I’m dedicating to reviewing the code and design of the ASP....

The Wonderful World of Webpack

Published at September 4, 2017 ·  5 min read

Webpack is a JavaScript module bundler, or so the blurb goes. This is an apt name for it. However, what I would like to do in this article, is to expand on the true power of Webpack. This article will not explain how to use Webpack. Rather, explain the reasoning behind it, and what makes it more special than just a bundler. Webpack is still a Bundler One of the main reasons for tools like Webpack is to solve the dependency problem....

ASP.NET Core 2.0 - Repository Overview: Action Discovery

Published at September 2, 2017 ·  8 min read

Previously in this Series ASP.NET Core MVC - Repository Overview: Model Binding ASP.NET MVC Core - Repository Overview: Value Providers Contents Introduction Registering Actions Finding Controller Actions The Controller Feature Provider The Default Application Model Provider Customising Controller Action Discovery Finding Razor Pages The Razor Project PageRouteModel Provider The Compiled PageRouteModel Provider Razor Pages Route Template Summary Introduction This article is the third in a series I’m dedicating to reviewing the code and design of the ASP....

A type-safe REST

Published at August 28, 2017 ·  4 min read

In the current age of microservices, we have communication between different processes across a wide variety of hosts and platforms. At other times, we integrate with 3rd party libraries, downloading information and metadata that may be necessary for our current application. On some of those occasions, we need to interact with a REST API. Wouldn’t it be nice if when interacting with REST APIs, we could allow the compiler to help us out?...

ASP.NET MVC Core – Repository Overview: Value Providers

Published at August 25, 2017 ·  11 min read

Value providers are part of the model binding ecosystem, and so if you want a more general overview, please see the first post within this series. Contents Introduction What is a value provider? How it all works MvcOptions Value Provider Factories The Controller Context The Composite Value Provider Binding Sources Why? Creating your own Value Provider Summary Introduction This is the second installment of blog posts that I will be sharing over the coming weeks that discuss the ASP....

ASP.NET MVC Core – Repository Overview: Model Binding

Published at August 21, 2017 ·  6 min read

I think that the best way to learn how to code, is to read code. That is why I think the number one tool out there for an aspiring developer is GitHub. When I found out that the ASP.NET Core team at Microsoft were going to open source their platforms, I was ecstatic. Not just because of the open source movement, but because it would be my chance to learn the techniques used at Microsoft, and how they provide such a wonderful framework to work in....

Sharing Controller and Views in ASP.NET Core

Published at August 15, 2017 ·  2 min read

This post will describe how to share controllers and views across ASP.NET Core applications, shared via an ASP.NET Core library. Best practices within the model-view-controller (MVC) world dictate that we should keep our controllers as thin as possible. Controllers should be extracted away from business logic, operational logic, and any sort of decision making. The only real thing controllers should be doing, are acting as a bridge. A bridge from the http world, to the domain logic of an application....

Docker Compose for a Simpler Life

Published at August 15, 2017 ·  7 min read

Docker is a tool that allows you to create containers on the fly, allowing you to easily deploy applications on any environment. This blog post won’t give you the in’s and out’s of all that is Docker. Docker is too big to delve into as a whole in one blog post. This post will discuss docker-compose; a tool that runs and synchronises containers simultaneously. I am a windows man by nature - I am a ....

The Interface Segregation Principle

Published at August 3, 2017 ·  5 min read

Why is the single responsibility principle (SRP) so hard to define? From my experience, SRP stumbles people much more than any other SOLID principle. I thought back to my own struggles with the five principles, and thought it would be better to explain SOLID in a different way; or rather, a different order. What is an interface? a point where two systems, subjects, organizations, etc. meet and interact. When A wants to interact with B, A will communicate through interface C, for which A and B mutually understands....

Using IConfigureOptions<T>

Published at July 30, 2017 ·  3 min read

The configuration API in ASP.NET core is now a first-class citizen. It is now easier than ever to configure applications within a .NET application. If you visit the main documentation page Configuration in ASP.NET Core it will give you detailed instructions on how to use it. One part of the documentation discusses the IOptions snapshot. This allows you to take a configuration file - typically json - and automatically deserialise it into a plain old CLR object (POCO)....