![]() |
VOOZH | about |
dotnet add package WebApiSkeleton.Contracts.Validation --version 1.1.1
NuGet\Install-Package WebApiSkeleton.Contracts.Validation -Version 1.1.1
<PackageReference Include="WebApiSkeleton.Contracts.Validation" Version="1.1.1" />
<PackageVersion Include="WebApiSkeleton.Contracts.Validation" Version="1.1.1" />Directory.Packages.props
<PackageReference Include="WebApiSkeleton.Contracts.Validation" />Project file
paket add WebApiSkeleton.Contracts.Validation --version 1.1.1
#r "nuget: WebApiSkeleton.Contracts.Validation, 1.1.1"
#:package WebApiSkeleton.Contracts.Validation@1.1.1
#addin nuget:?package=WebApiSkeleton.Contracts.Validation&version=1.1.1Install as a Cake Addin
#tool nuget:?package=WebApiSkeleton.Contracts.Validation&version=1.1.1Install as a Cake Tool
WebApiSkeleton.Contracts.Validation contains MediatR PipelineBehavior
implementation to validate incoming requests that
implement
using FluentValidation
Steps to add contract validation:
AbstractValidator<T> for needed requestsAddContractValidatorsFromAssembly (or AddValidatorsFromAssembly from FluentValidation) to add validators to
DIAddValidationPipelineBehaviorsFromAssembly that will automatically search for classes that
are inherited from AbstractValidator and add for requests that are
passed as a generic parameter in DI. If any of these requests are not returning the Result<A> type
the InvalidOperationException is thrown.
ValidationBehavior for request is automatically added, so it is highly recommended to
mind the order
of IPipelineBehavior implementations added in DI.ValidationBehavior implementations by
calling method
and then add it manually to DI by passing the pipelineBehavior as a service type and validationBehavior as
implementation type. This way order of pipeline behaviors executed for each request is handled more clearly by the
user, which is adding them.Example usage shown in
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on WebApiSkeleton.Contracts.Validation:
| Package | Downloads |
|---|---|
|
WebApiSkeleton.FileSystem.MinIO
Package containing implementation of file system based on Minio S3 storage. |
|
|
WebApiSkeleton.Security
Package containing security core implementation that is based on MediatR and other WebApiSkeleton MediatR-related packages. |
This package is not used by any popular GitHub repositories.