GSoft.ComponentModel.DataAnnotations 1.1.0

Prefix Reserved
dotnet add package GSoft.ComponentModel.DataAnnotations --version 1.1.0                
NuGet\Install-Package GSoft.ComponentModel.DataAnnotations -Version 1.1.0                
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="GSoft.ComponentModel.DataAnnotations" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GSoft.ComponentModel.DataAnnotations --version 1.1.0                
#r "nuget: GSoft.ComponentModel.DataAnnotations, 1.1.0"                
#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 GSoft.ComponentModel.DataAnnotations as a Cake Addin
#addin nuget:?package=GSoft.ComponentModel.DataAnnotations&version=1.1.0

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

GSoft.ComponentModel.DataAnnotations

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

nuget build

Getting started

dotnet add package GSoft.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
NotEmptyAttribute Validate 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, GSoft Group Inc. 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 GSoft.ComponentModel.DataAnnotations:

Package Downloads
GSoft.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.