Sample of using ResultFilter and ValueTuple when building an API with ASP.NET Core
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md

README.md

Cleaner API Code with ResultFilter and ValueTuple

Examples of:

  • mapping two objects into one with AutoMapper
  • using a custom reusable ResultFilter to map those objects instead of writing the code in each action that requires it
  • using the new ValueTuple (C#7) to pass the two objects to the filter

There's a lot of comments in the code so it should be easy to understand. If needed, additional explanation is available here: https://www.kevindockx.com/cleaner-api-code-with-resultfilter-and-valuetuple/