WeNerds.Filters 1.0.2

dotnet add package WeNerds.Filters --version 1.0.2
                    
NuGet\Install-Package WeNerds.Filters -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="WeNerds.Filters" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WeNerds.Filters" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="WeNerds.Filters" />
                    
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 WeNerds.Filters --version 1.0.2
                    
#r "nuget: WeNerds.Filters, 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 WeNerds.Filters@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=WeNerds.Filters&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=WeNerds.Filters&version=1.0.2
                    
Install as a Cake Tool

WE Filters

Open-source Commons Filters developed to facilitate the creation of a new project in .Net, providing some commons middlewares.

Something is missing? Submit a new product feature request using the issues tracker..

✨ Using the library

👉 Step 1 - Install library into project

  • Package Manager
$ Install-Package WeNerds.Filters
  • .Net CLI
$ dotnet add package WeNerds.Filters

👉 Step 2 - Using the Filters<br> In the topics of each filter available in the package, how to register will be explained.

✨ About the Filters

WeResultHandlerFilter

This filter will be responsible for ensuring that in each response, if there is a message in WeNotification, the API response is modified.
Therefore, if there is any record in WeNotification, regardless of the value in the response, it will be manipulated following the following rule:

  • Will always return an object of type WeResponse<IEnumerable<WeNotification>>
  • The Success field will have the value false
  • The Data field will contain a list of WeNotification
  • The request StatusCode may be as follows: 403, 401, 404, 400
    • The priority is exactly this, that is, if the message list has at least one Status403Forbidden message, the request status will be 403, otherwise it checks if there is at least one Status401Unauthorized message, if it has the request status it will be 401, and so on until it reaches status 400.
Important:

For correct operation, this filter depends on the WeNotification service also being used.

How to use?

How this filter works is very simple, just register it in program.cs and that's it.

builder.Services.AddControllersWithViews(options =>
{
    options.Filters.Add<WeResultHandlerFilter>();
});

✨ Contacts

📧 Email - leo.cavalheiro.ti@gmail.com

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 223 7/19/2024
1.0.1 184 7/5/2024
1.0.0 172 7/5/2024