You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.ComponentModel.Annotations provides attributes and classes for adding metadata to your data models. Common uses include:
1. Validation: Attributes like [Required], [StringLength], and [Range] for data validation.
2. Display: Attributes like [Display] to specify display names and formats.
3. Metadata: Attributes like [MetadataType] for associating metadata with types.
using System.ComponentModel.DataAnnotations;publicclassPerson{[Required]// Marks this property as required[StringLength(100)]// Sets the maximum lengthpublicstringName{get;set;}[Range(0,120)]// Specifies acceptable range for the agepublicintAge{get;set;}}
The text was updated successfully, but these errors were encountered:
System.ComponentModel.Annotations provides attributes and classes for adding metadata to your data models. Common uses include:
https://swagger.io/docs/specification/data-models/data-types/ -> Minimum and Maximum
The text was updated successfully, but these errors were encountered: