Zone of Development

by Damiano Abballe

Category: Web API

Web API – How to use Polly library with Ocelot

In this post, we will see how to use the Polly library in the Microservices project created in the post: Web API – IHttpClientFactory.But, what is the Polly library?From the Official web site:“Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback […]

Read More

Web API – IHttpClientFactory

In this post, we will see how to use IHttpClientFactory, in order to invoke a Web API.IHttpClientFactory is available since .NET Core 2.1 and it provides a central location for naming, configuring and consuming logical HttpClients in our application. For this post, we will use the project created in the post: Web API – Gateway […]

Read More

WEB API – Gateway with Ocelot

In this post, we will see how to create an API Gateway using Ocelot. First of all, why should we use an API Gateway?From Microsoft web site:“In a microservices architecture, the client apps usually need to consume functionality from more than one microservice. If that consumption is performed directly, the client needs to handle multiple […]

Read More

Web API – Unit Tests

In this post, we will see how to implement Unit Tests for the Web API created in the post: Docker – Web API and Sql Server. First of all, we open Visual Studio and we add a xUnit Test Project called TestWebApiServices: Then, we add a file called UserControllerUnitTests, where we will define all objects […]

Read More

Web API – Versioning

In this post, we will see how to manage the versioning in a .net core Web API service, using three different approaches:1) Query String-Based Versioning2) URL-Based Versioning3) HTTP Header-Based VersioningFirst of all, we open Visual Studio 2019 and we create a Web API project: If we run the application, this will be the output: Now, […]

Read More

Web API – ASP.NET Core

In this post, we will see how to create a RESTful Web Service with ASP.NET Core. We open Visual Studio 2019 and select the template ASP.NET Core Web Application. Then, we select the API template, framework 2.2 and then we click on Create. At the end, we will have a project like that: If we […]

Read More