Generic object factory for classes with non public constructor in C#

In this post I want to talk about a common need that we could have in an applications, that is an object factory. Of course, we could have different requirements about the implementation of it, but the most widespread is a generic factory like this: This is a very simple implementation, but with the new … Continue reading Generic object factory for classes with non public constructor in C#

Using adapter pattern to parse HTML with C# and AgilityPack

Recently I faced with a business requirement about extracting informations from some html pages and display them in a local application. The principal problem that I found was that the result were in html format and I needed to transform that in a c# object, in order to be able to manage the informations in … Continue reading Using adapter pattern to parse HTML with C# and AgilityPack

Looking deep inside OData Controllers

ASP.NET 4.5 has three different class which we can inherits to implements the controllers: Controller, ApiController and ODataController. In the latest applications that I implemented, because they were SPA, I used rarely the classic Controller (know as MVC controllers) and I developed a huge number of ApiController and ODataController. The first ones are used to … Continue reading Looking deep inside OData Controllers

Build and run an ASP.NET Core application with Docker

The topic of this post is a new technology that widespread in the world of the virtualization, that is Docker. It is based on the concept of the containers, every application that runs on docker is a container, that is a lightweight executable package that contains all the dependencies that the application needed to run. … Continue reading Build and run an ASP.NET Core application with Docker

Managing OAuth 2 authentication with Swagger

In this post I want to talk about a product that could help us to produce documentation about the Web API services implemented in our application. Swagger is a popular framework that once installed in an ASP.NET application is able to produce documentation about all the Web API implemented in the project. Furthermore it give … Continue reading Managing OAuth 2 authentication with Swagger