Tiny guard library for fluent precondition assertion. Current it is implemented for use with c#. Maybe a support for TypeScript and Java may be added.
Also in the near future a .net core / .net standard release will be aviable.
Feel free to fork !
Offers a fluent way for making preconditions in a guard style. The idea is to have preconditions always in the same syntax and have less code.
NotNull Check
Preconditions
.For(DomainObjectId, nameof(DomainObjectId))
.NotNull();
Using lambdas instead of hardcoded name
Preconditions
.For(()=> DomainObjectId)
.NotNull();
Multiple checks
Preconditions
.For(DomainObjectId, nameof(DomainObjectId))
.NotNull()
.MinLength(3);
Validaten models annotated with System.ComponentModel.DataAnnotations
Preconditions
.For(()=>Model)
.NotNull()
.ValidateModel();
- Add api-documentation
- Make better names
- Support .net standard
- Implement TypeScript
#Nuget Package https://www.nuget.org/packages/FluentGuard