/CleanCodeResultFilterSample

Sample of using ResultFilter and ValueTuple when building an API with ASP.NET Core

Primary LanguageC#MIT LicenseMIT

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/