Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters 1.0.2

dotnet add package Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters --version 1.0.2
                    
NuGet\Install-Package Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters --version 1.0.2
                    
#r "nuget: Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters&version=1.0.2
                    
Install as a Cake Tool

ASP.NET Core Action Filters

License Language Frameworks CI

A collection of reusable action filters that I have implemented and used in several ASP.NET Core applications, providing common functionality for some of or all the action methods in each application.

1. ValidateRequestParameters

Validates the parameters of an action method using the IValidator<T> implementation registered in the dependency injection container.

Usage
  1. Install package from NuGet via the .NET CLI, Package Manager Console or any other preferred method:

    • .NET CLI
    dotnet add package Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters
    
    • Package Manager Console
    Install-Package Olumuyiwa.DotNetDevKit.AspNetCore.ActionFilters
    
  2. Register the IValidator<T> implementation in the dependency inject container in the ConfigureServices method of your Startup.cs file or directly in your Program.cs file:

services.AddScoped<IValidator<CreateUserRequest>, CreateUserRequestValidator>();
  1. Apply the ValidateRequestParameters attribute to your action method:
[HttpPost]
[ValidateRequestParameters]
public async Task<IActionResult> CreateUser(CreateUserRequest request)
{
	// Your action method implementation
}

or to your entire controller:

[ApiController]
[ValidateRequestParameters]
[Route("api/[controller]")]
public class UsersController : ControllerBase
{
	// Your controller implementation
}

or to all your controllers:

services.AddControllers(options =>
{
	options.Filters.Add<ValidateRequestParametersAttribute>();
});

2. Coming soon...

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 99 8/17/2025
1.0.1 102 8/17/2025
1.0.0 99 8/17/2025