https://github.com/brenordv/validator-dot-net
Handful of methods inside Validate class to help perform standardized checks and catch the appropriate exceptions. This is a project ported from a private corporate application in an attempt to reduce code duplication. Feel free to use as you see fit.
https://github.com/brenordv/validator-dot-net
dotnet dotnet-core nuget nuget-package
Last synced: 3 months ago
JSON representation
Handful of methods inside Validate class to help perform standardized checks and catch the appropriate exceptions. This is a project ported from a private corporate application in an attempt to reduce code duplication. Feel free to use as you see fit.
- Host: GitHub
- URL: https://github.com/brenordv/validator-dot-net
- Owner: brenordv
- License: mit
- Created: 2021-09-14T17:07:02.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-27T13:00:07.000Z (almost 3 years ago)
- Last Synced: 2025-01-20T08:13:06.789Z (5 months ago)
- Topics: dotnet, dotnet-core, nuget, nuget-package
- Language: C#
- Homepage: https://www.nuget.org/packages/raccoon.ninja.validator.net
- Size: 108 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)# Validator .Net
This project consist in a handful of convenience methods to perform common validations. You can try to validate something, in which case the method will return a boolean or do a "hard validation" that will throw an exception in case of failure.All exceptions are in a hierarchy, ensuring ease of use while working with try-catches.
The motivation for this project was to centralize validation helpers and reduce code duplication across a myriad of internal projects.
The idea here is not to replace simple if statements, but to create a standardized and clean way to make validations and capture exceptions when any errors occur.
# Exception hierarchy
- System.Exception
- BaseValidationException
- DynamicPropertyNotFoundException
- EmptyListException
- NoRowsAffecetedException
- TextTooBigException
- UnexpecctedException
- ElementComparisonException
- NotEqualToException
- NotGreaterThanException
- NotGreaterThanOrEqualToException
- NotLessThanException
- NotLessThanOrEqualToException
- TypingException
- DateTimeNotInUtcException
- InvalidEnumException
- InvalidGuidException
- NullRequiredValueException
- TextNullOrEmptyException
- NumberException
- InvalidIntegerException
- InvalidUtcOffsetException
- NotAllNumbersPositiveException# Documentation
Autogenerated documentation.
[Docs/ValidatorDotNet.md](./Docs/ValidatorDotNet.md)# Local build
To build this package locally, you must have the doc generator installed:
```shell
dotnet tool install xmldocmd -g
```The documentation will be (re-)generated automatically after every Release build.