Long-running background processes have been a need for long and for over the years, this has been accomplished in various approaches in .Net. With the introduction of Worker Service templates, it has become a lot easier to create asynchronous long-running background tasks that are supported across platforms and have inbuilt capabilities like Dependency Injection. The … Continue reading A2Z.Net : B – BackgroundService
Tag: Web API
EcSolvo.RestHelper Nuget
Recently I have started working on a Nuget Package for providing a is a sleek and simple Wrapper library for providing simple access to Rest API, by hiding away the complexities of HTTPClient Class.Named EcSolvo.RestHelper it is particularly designed to work along with Xamarin PCL Projects You can follow and contribute to the Nuget in Github … Continue reading EcSolvo.RestHelper Nuget
Unit Test for Methods that Call Web API
HttpClient helps you interact with your Rest API's through its asynchronous methods such as GetAsync. But on a TDD environment, it could become a challenge on how you could write Unit Test cases for a method that invokes the API via GetAsync and ensure that your call successfully invokes the API (considering your API sits in another … Continue reading Unit Test for Methods that Call Web API
Fix CORS in Firefox
CORS is a hated word anyone working on Web Solutions might have encountered if your website is accessing another website or API. So how do you ensure your website is able to the required URL ? The first and easiest fix would be to include "Access Control" headers in your web.config. That should be it … Continue reading Fix CORS in Firefox
Exception Handling in Web API (Part 2): Exception Filter (Extended)
The Exception Filter implementation mentioned in the Part1 of the article is fairly simple and straightforward. But as you start supporting more and more Exceptions, the Cyclomatic Complexity of the "OnException" method would increase because of the "if" condition nature. A cleaner implementation of the Filter is shown below using Dictionary. Isn't that cleaner ?
Exception Handling in Web API (Part 1): Exception Filter
The Web World, especially Web Services is fast moving towards the more abstract simpler Web API. This article is not focused on comparing Web Service and Web API, but rather it focuses on Exception Handling in Web API. By default, the most common exception that an API Controller raises are translated into an HTTP Status … Continue reading Exception Handling in Web API (Part 1): Exception Filter