Data Annotations in ASP.NET Core
Data annotation can be used most commonly in in ASP.NET Core MVC or ASP.Net Data controls to perform model validation. Data annotations (available as part of the System. ComponentModel. DataAnnotations namespace, are attributes that can be applied to classes or class members to specify the relationship between classes, describe how the data is to be displayed in the UI, and specify validation rules. This article briefly tells you about data annotations, why they are useful, and how to use them in our .NET Core applications. Types of Data Annotations DA attributes are used to specify metadata on a class or a property. The data annotation attributes can broadly be classified into the following: Validation attribute — Used to enforce validation rules on the properties of the entities Display attribute — Used to specify how the data should be displayed in the user interface Modeling attr...
Well done, really helpful.
ReplyDeletethanks zanesarfraz
Delete