Lesson 2: Overview of .NET Data Annotations and a Sample of Using Them in C#

Published: 09 February 2024
on channel: Paul D. Sheriff
292
12

Lesson 2: Overview of .NET Data Annotations and a Sample of Using Them in C#

This lesson provides a quick overview of what a Data Annotation is. Data Annotations inherit from the ValidationAttribute class and thus all have an ErrorMessage property. The ErrorMessage property can have placeholders to substitute different data without you hard-coding data.

Be sure to watch this lesson as it provides background for the rest of the course. It also introduces you to the basic code you need to write to validate data annotations in any application.

Content
Lesson Objectives 00:00
What is a Data Annotation 00:23
The ErrorMessage Property 01:32
ErrorMessage Property Placeholders 01:47
Localize the ErrorMessage Property 02:19
DEMO: A Data Annotation Sample 02:51
Lesson Summary 05:22

Useful Links
Samples and hands-on labs for this course: https://www.pdsa.com/YouTube

System.ComponentModel.DataAnnotations Namespace: https://learn.microsoft.com/en-us/dot...

#dataannotation #validation #csharp #development #programming #dotnet #dotnetcore #dotnet6 #dotnet #dotnet8 #pauldsheriff #pluralsight #youtube

Paul.About()
Hello, my name is Paul D. Sheriff and I have a passion for teaching. I have been training developers for over 35 years through books, videos, article, blog posts, and international conferences and user groups.

Paul.Contact()
Website: https://www.pdsa.com
Email: [email protected]
LinkedIn:   / paulsheriff  
Blog: https://blogs.pdsa.com/
Pluralsight: https://app.pluralsight.com/profile/a...
YouTube Channel: @pauldsheriff


Watch video Lesson 2: Overview of .NET Data Annotations and a Sample of Using Them in C# online without registration, duration hours minute second in high quality. This video was added by user Paul D. Sheriff 09 February 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 292 once and liked it 12 people.