Workleap.ComponentModel.DataAnnotations 1.5.1

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Workleap.ComponentModel.DataAnnotations --version 1.5.1                
NuGet\Install-Package Workleap.ComponentModel.DataAnnotations -Version 1.5.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Workleap.ComponentModel.DataAnnotations" Version="1.5.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Workleap.ComponentModel.DataAnnotations --version 1.5.1                
#r "nuget: Workleap.ComponentModel.DataAnnotations, 1.5.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Workleap.ComponentModel.DataAnnotations as a Cake Addin
#addin nuget:?package=Workleap.ComponentModel.DataAnnotations&version=1.5.1

// Install Workleap.ComponentModel.DataAnnotations as a Cake Tool
#tool nuget:?package=Workleap.ComponentModel.DataAnnotations&version=1.5.1                

Workleap.ComponentModel.DataAnnotations

Provides multiple new data annotation attributes, such as [Guid], [NotEmpty], [ValidateProperties].

nuget build

Getting started

dotnet add package Workleap.ComponentModel.DataAnnotations

Decorate your properties, fields and method parameters with these new data annotation attributes.

Most of them are validation attributes that can be used in model validation. They work the same way as built-in .NET data annotations such as [Required], [Range], [RegularExpression], etc.

The most useful validation attribute here is probably ValidatePropertiesAttribute, as it validates all the properties of an object. This allows in-depth, nested validation of an entire complex object graph.

List of data annotation attributes

Attribute Description
GuidAttribute Validates that a string property is a well-formatted GUID with an optional format
ContainsNonEmptyGuidAttribute Validates that a Guid enumerable property contains at least one non-empty Guid
ContainsNonEmptyStringAttribute Validates that a String enumerable property contains at least one non-empty String
ContainsOnlyNonEmptyGuidsAttribute Validates that a Guid enumerable property contains only non-empty Guids
ContainsOnlyNonEmptyStringsAttribute Validates that a String enumerable property contains only non-empty Strings
NotEmptyAttribute Validates that an enumerable property is not empty
ValidatePropertiesAttribute Validates all properties of a complex type property (nested object validation)
TimeSpanAttribute Validates that a string property is a well-formatted TimeSpan with an optional format
UrlOfKindAttribute Validates that a string or Uri property is a well-formatted url of the specified UriKind
ContainsAttribute Validates that a string contains the specified substring (casing can be specified)
StartsWithAttribute Validates that a string starts with the specified substring (casing can be specified)
EndsWithAttribute Validates that a string ends with the specified substring (casing can be specified)
ProvidedByAzureKeyVaultAttribute Indicates that a property value might be loaded from Azure Key Vault (has no effect)
ProvidedByAzureAppConfigAttribute Indicates that a property value might be loaded from Azure App Configuration (has no effect)
SensitiveInformationAttribute Indicates that a property contains sensitive information, such as personally identifiable information (PII), or any other information that might result in loss of an advantage or level of security if disclosed to others (has no effect)
NonSensitiveInformationAttribute Indicates that a property does not contain sensitive information (has no effect)

License

Copyright © 2022, Workleap. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/gsoft-license/blob/master/LICENSE.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Workleap.ComponentModel.DataAnnotations:

Package Downloads
Workleap.Extensions.Mongo.Abstractions

Provides MongoDB access through .NET dependency injection, following Microsoft.Extensions.* library practices.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.2-preview.21 34 11/16/2024
1.5.2-preview.20 39 10/31/2024
1.5.2-preview.19 39 10/30/2024
1.5.2-preview.18 38 10/28/2024
1.5.2-preview.17 38 10/28/2024
1.5.2-preview.16 36 10/28/2024
1.5.2-preview.15 49 10/1/2024
1.5.2-preview.14 40 10/1/2024
1.5.2-preview.13 48 9/30/2024
1.5.2-preview.12 45 9/20/2024
1.5.2-preview.11 55 9/13/2024
1.5.2-preview.10 48 9/6/2024
1.5.2-preview.9 44 8/27/2024
1.5.2-preview.8 44 8/27/2024
1.5.2-preview.7 69 8/16/2024
1.5.2-preview.6 47 8/1/2024
1.5.2-preview.5 45 7/23/2024
1.5.2-preview.4 37 7/23/2024
1.5.2-preview.3 61 7/15/2024
1.5.2-preview.2 38 7/5/2024
1.5.2-preview.1 54 6/14/2024
1.5.1 34,908 6/4/2024
1.5.1-preview.1 53 6/4/2024
1.4.1-preview.14 60 5/31/2024
1.4.1-preview.13 56 5/31/2024
1.4.1-preview.12 55 5/21/2024
1.4.1-preview.11 65 5/10/2024
1.4.1-preview.10 43 5/3/2024
1.4.1-preview.9 70 4/15/2024
1.4.1-preview.8 66 4/12/2024
1.4.1-preview.7 64 4/3/2024
1.4.1-preview.6 51 4/3/2024
1.4.1-preview.5 57 3/8/2024
1.4.1-preview.4 63 3/7/2024
1.4.1-preview.3 73 3/4/2024
1.4.1-preview.2 56 3/4/2024
1.4.1-preview.1 77 3/1/2024
1.4.0 70,954 2/29/2024
1.3.2-preview.3 56 2/29/2024
1.3.2-preview.2 65 2/16/2024
1.3.2-preview.1 65 2/15/2024
1.3.1 24,960 2/13/2024
1.3.1-preview.9 58 2/13/2024
1.3.1-preview.8 67 2/6/2024
1.3.1-preview.7 60 2/6/2024
1.3.1-preview.6 63 1/22/2024
1.3.1-preview.5 65 1/12/2024
1.3.1-preview.4 58 1/12/2024
1.3.1-preview.3 52 1/12/2024
1.3.1-preview.2 77 12/18/2023
1.3.1-preview.1 98 11/26/2023
1.3.0 53,719 11/17/2023
1.2.1-preview.5 69 11/17/2023
1.2.1-preview.4 62 11/17/2023
1.2.1-preview.3 68 11/13/2023
1.2.1-preview.2 68 11/7/2023
1.2.0 31,866 10/31/2023
1.1.1 39,552 7/20/2023