DynamicVNET 1.3.1-alpha
See the version list below for details.
dotnet add package DynamicVNET --version 1.3.1-alpha
NuGet\Install-Package DynamicVNET -Version 1.3.1-alpha
<PackageReference Include="DynamicVNET" Version="1.3.1-alpha" />
paket add DynamicVNET --version 1.3.1-alpha
#r "nuget: DynamicVNET, 1.3.1-alpha"
// Install DynamicVNET as a Cake Addin #addin nuget:?package=DynamicVNET&version=1.3.1-alpha&prerelease // Install DynamicVNET as a Cake Tool #tool nuget:?package=DynamicVNET&version=1.3.1-alpha&prerelease
DynamicVNET - Overview
DynamicVNET is .NET Standard library that was created help to develop reuse dynamic validation. It helps to build some rules on POCO and own blackbox libs. It has rich conveniences and features as a <strong>Fluent API</strong> in runtime, wrapped over <strong>DataAnnotation</strong> attributes and supports a cross-platform environment.
Support
- Branching & Nested Branching [synonim logical tree].
- Nested Members.
- Value Types & Single Primitive.
- Reference Types (class).
- Automatic ignoring of repeated validation.
- Strongly Self Validator via Inheritance.
Where is using ?
- POCO Validation.
- Dynamic validation for private libraries (third party libraries 'dll').
Validation methods
- Predicate (Custom)
- StringLen
- EmailAddress
- PhoneNumber
- Url (for GET)
- Required
- MaxLen
- RegularExp
- Range
- Null (Only reference type)
- NotNull (Only reference type)
Example
POCO Models.
public class Employee
{
public string Name { get; set; }
public Token TokenNumber { get; set; }
public string Email { get; set; }
}
public class Token
{
public string Number { get; set; }
}
Validation.
Employee emp = new Employee()
{
Name = "Jhon",
TokenNumber = new Token() { Number = "2312412312341" },
Email = "jhon.sim@gmail.com"
};
var validator = new Validator<Employee>(builder => {
builder.StringLen(x => x.Name, 4)
.EmailAddress(x => x.Email)
.Predicate(x => x.Email.Contains("@simple.com"))
.Required(x => x.TokenNumber.Number) // nested member
.Required(x => x.TokenNumber.Number); // automatic ignored
});
bool result = validator.IsValidate(emp);
Detailed Result.
IEnumerable<ValidationMarkerResult> results = validator.Validate(emp);
// Only invalid results or all results.
IEnumerable<ValidationMarkerResult> results = validator.ValidateAll(emp);
Branch Example
var validator = new Validator<Model>(builder => {
builder.Required(x => x.Token.TokenNumber)
.Branch(x => x.Name.Contains("resul"), x =>
{
x.Required(y => y.Email)
.StringLen(y => y.Email, 2)
.Branch(n => n.Name.Length >= 4,n => {
n.MaxLen(s => s.Token.TokenNumber, length: 4);
});
}).Branch(x => x.Email.Contains("aa"), x =>
{
x.Required(y => y.Name)
.StringLen(y => y.Name, 5)
.StringLen(y => y.Token.TokenNumber, 9);
});
});
Example Strongly Self Validator
public class EmployeeValidator : Validator<Employee>
{
public EmployeeValidator()
{
builder.SetMember(x => x.Name)
.Required()
.Branch(x => x.Name.Contains("jhon"), x =>
{
x.MaxLen(m => m.TokenNumber.Number, 15);
})
.SetMember(x => x.Email)
.Required()
.EmailAddress()
.Required(x => x.TokenNumber.Number);
}
}
Employee emp = new Employee()
{
Name = "selman:okkes",
TokenNumber = new Token() { Number = "adasd123123asd" },
Email = "jhon.sim@jhona.com"
};
var empValidator = new EmployeeValidator();
bool result = empValidator.IsValidate(emp);
Where can I get it?
Install DynamicVNET from the package manager console:
PM> Install-Package DynamicVNET -Version 1.3.1-alpha
License & Copyright
DynamicVNET is Copyright © 2018 Rasul Huseynov and lincensed under the MIT license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.ComponentModel.Annotations (>= 4.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DynamicVNET:
Package | Downloads |
---|---|
DynamicVNET.Lib.AspNetCore
DynamicVNET.Lib extension for asp.net core. Extensible AOP (interceptor filter). Also allows to reuse marker validation. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.4.1 | 84 | 10/31/2024 |
1.4.0 | 81 | 10/31/2024 |
1.4.0-beta | 326 | 12/31/2020 |
1.3.1-alpha | 332 | 7/30/2020 |
1.2.6 | 844 | 12/24/2018 |
1.2.5 | 664 | 12/20/2018 |
1.2.3 | 675 | 10/28/2018 |
1.2.2 | 744 | 9/23/2018 |
1.2.1 | 768 | 9/10/2018 |
1.2.0 | 795 | 9/7/2018 |
1.2.0-alpha | 626 | 8/29/2018 |
1.1.1 | 747 | 8/23/2018 |
1.1.0 | 763 | 8/13/2018 |
1.0.3 | 777 | 8/7/2018 |