Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aimenux/webapihostingdemo

Using various hosting ways in order to setup a web api
https://github.com/aimenux/webapihostingdemo

fluent-assertions integration-testing minimal-api net60 nsubstitute serilog webapi

Last synced: 23 days ago
JSON representation

Using various hosting ways in order to setup a web api

Awesome Lists containing this project

README

        

[![.NET](https://github.com/aimenux/WebApiHostingDemo/actions/workflows/ci.yml/badge.svg)](https://github.com/aimenux/WebApiHostingDemo/actions/workflows/ci.yml)

# WebApiHostingDemo
```
Exploring various hosting ways in order to setup a web api
```

> In this repo, i m exploring various hosting ways in order to setup a web api
>
> :one: `Example01` use default template with controller(s) and [top level statements](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/top-level-statements) program class
>
> :two: `Example02` use startup class with controller(s) and program class based on [generic host](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host)
>
> :three: `Example03` use startup class with controller(s) and program class based on [web application](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.webapplication)
>
> :four: `Example04` is very similar to `Example03` with an [elegant way to call startup class behind the scenes](https://www.strathweb.com/2022/02/using-an-existing-startup-class-with-asp-net-6-minimal-hosting-model/)
>
> :five: `Example05` use [minimal api template](https://docs.microsoft.com/en-us/aspnet/core/tutorials/min-web-api)
>

**`Tools`** : vs22, net 6.0, web api, serilog, integration-testing, fluent-assertions, nsubstitute