Posts

Showing posts with the label Web API

Creating RESTful Minimal WebAPI in .Net 6 in an Easy Manner! | FastEndpoints

Image
  We might have developed Web APIs using MVC Controllers where we used to give Route Path Attributes to the Controller and  to identify individual methods we used to provide Actions in the Route. With the Controller approach we need to write boiler plate code in separate files which deals with the Configuration of the Web Service. Those who have worked in Node js would be aware of how easy it is to create a Web API and expose different Endpoints without the need of so much boiler plate code. Here we are going to discuss of similar approach for creating a Web API in .Net6 using FastEndpoints. Under the hood it uses Minimal API concept which tries to reduce the dependencies required to achieve a particular task. This approach is more suitable in the case of Microservice Architecture where we want to keep the dependencies to minimum. Must Read : Fluent API and Data Annotations What are FastEndpoints? FastEndpoints is a Framework compatible with .Net 6 which allows to build a...

How to Use OWIN to Self-Host ASP.NET Web API?

Image
  In a Service Oriented architecture where there are multiple services serving the request from different clients it becomes imperative to add additional capabilities to these services and allow the Services to describe itself. What is meant by Self-Hosting? Self Hosting is a term used commonly to host a web Application or a Backend Service in a custom exe like console application instead of hosting it in IIS or some other exe. It is normally done to reduce the bulkiness and additional overhead which comes with external hosting platforms. What is OWIN? OWIN stands for Open Web Interface for .NET which basically acts as a abstraction between the Web Application and the Web Server so this means that Web Application is no more tightly bound to the Web Server which is hosting the application. OWIN  provides some standard API through which the Web Server can communicate with the Web Application. It also provides some middleware functionality through which it is possible to add pipe...