Today I want to cover a very common scenario about how to create a HTTP client for a WebAPI 2 service. To present my implementation I will be using one of a Task<T> extension method that I described recently on my blog. Let`s start from defining an API service. In this example it udes a REST based WebApi service with the following implementation. [ AllowAnonymous ] public class CityController { /// <summary> /// The city repository. /// </summary> private readonly ICityRepository cityRepository; /// <summary> /// Initializes a new instance of the ...
Damian Zapart, Principal Engineering Manager @ Microsoft - official blog.