Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 16 days 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.

Awesome Lists containing this project

README

        

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=bugs)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=coverage)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=brenordv_validator-dot-net)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=brenordv_validator-dot-net&metric=vulnerabilities)](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.