Custom Validation and Class Level validation using Data Annotation in MVC .Net core application
In Previous article i have demonstrated about " Validations using entity framework data annotation in .Net core MVC " where i have implemented ready made validation types in MVC application. In this article i will be demonstrating about custom validation and class level validation using Data Annotation in MVC .Net core application. The custom validation will be very useful when we need to solve real time scenario where the ready made validation will not work. I also going to show about the class level validation which is also a type of custom kind validation available in data annotation using entity framework. Lets start the implementation, I going to use the same application which i have used in previous article. First we need to add few columns in existing employee table for validation demonstration as below. DateOfBirth DateOfJoin DateOfExit After adding above fields my model class will look like below using ModelsExample.Attributes; using System; using System.Co...