ardalis / ApiEndpoints

A project for supporting API Endpoints in ASP.NET Core web applications.
MIT License
3.13k stars 227 forks source link

Add support for IAsyncEnumerable #175 #176

Closed cmxl closed 2 years ago

cmxl commented 2 years ago

Solves #175

IAsyncEnumerable is only available since netstandard2.1. So I made the EndpointBase classes partial, added a new partial class file and removed it from compilation when the targetframework is not netstandard2.1

What I was not sure of, is how to add test for this feature.

ardalis commented 2 years ago

Can you add any tests or something in the sample demonstrating its usage?

cmxl commented 2 years ago

I just added tests and a sample endpoint. I had to add a direct project reference though, due to automapper failing to load the correct assembly when referencing a multitargeted project. That's also why I needed to add <SetTargetFramework>TargetFramework=netstandard2.1</SetTargetFramework> to the project reference in csproj files. Otherwise the netstandard2.0 version would have been referenced by default.