1

Minimal APIs Nuget Packages

 1 month ago
source link: https://wildermuth.com/2024/04/21/minimal-api-nuget-packages/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

I’ll make this post pretty quick. I’ve been looking at my Nuget packages and they’re kinda a mess. Not justthe packages, but the naming and branding. To start this annoying process, I’ve decided to move all my NuGet packages that support Minimal APIs to a common GitHub repo and package naming.

MinimalApis.Discovery

This package is to help you organize your Minimal APIs by using a code generator to automate registration of your APIs by implementing an IApi interface. You can read more about it here: Docs.

If you’ve been using my package to organize your Minimal APIs, the name of the package has been changed:

Was: WilderMinds.MinimalApiDiscovery
Now: MinimalApis.Discovery

The old package has been depreciated, and you can install the new package by simply:

> dotnet remove package WilderMinds.MinimalApiDiscovery
> dotnet add package MinimalApis.Discovery

MinimalApis.FluentValidation

The second package in this repository is MinimalApis.FluentValidation. I’m a big fan of how Fluent Validation works, but as I was teaching Minimal APIs - it was tedious to add validation. In .NET 7, Microsoft introduced Endpoint Filters as a good solution. You can read more about how this works at: Docs

This package hasn’t changed name, but has been moved from beta to release. You can update or install this package:

> dotnet add package MinimalApis.FluentValidation

Let me know what you think!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK