Releases: engineering87/SharpSanitizer
Releases · engineering87/SharpSanitizer
v3.0.0
This release introduces extended constraints, improved sanitization logic, updated documentation, and full support for .NET 9.
✨ New Features
- New Constraints
NotNullOrEmpty→ ensures strings are not null or empty.NotNullOrWhiteSpace→ ensures strings are not null or whitespace.Positive→ enforces values greater or equal to 0.StrictPositive→ enforces values strictly greater than 0.NonZero→ disallows zero values.RoundTo→ rounds numbers to a specified number of decimals.NotEmptyCollection→ ensures collections are not empty.DistinctCollection→ ensures collections contain distinct elements.
🔧 Improvements
- Refactored sanitization logic with better handling for:
- Numeric types (
int,long,float,double,decimal) - String validation and normalization
- Collections and objects (
NotNull,NoDbNull,DistinctCollection)
- Numeric types (
- Added stricter Strict vs Relaxed validation modes.
📚 Documentation
README.mdimproved with:- A Supported Constraints table in Markdown.
⚙️ Build & CI
- Bumped target framework to .NET 9.
- Updated GitHub Actions workflow (
dotnet.yml) to run with .NET 9 SDK. - Verified builds, tests, and NuGet packaging under .NET 9.
✅ Testing
- Extended unit test coverage for all new constraints.
- Verified sanitization behavior across string, numeric, object, and collection types.
- All tests passing successfully on .NET 9.
v2.2.0
Bump to .NET 8
v2.1.0
Added ValidDatetime e ForceValidDateTime rules
v2.0.0
Update to .NET 6
Add decimal and double support
v1.0.0
Data Type supported:
- Object
- String
- Integer
Rules supported:
- NotNull
- Max
- MaxNotNull
- Min
- NotNegative
- Uppercase
- Lowercase
- NoWhiteSpace
- NoSpecialCharacters