This tutorial shows how to valid an email using System.ComponentModel.DataAnnotations in c# code.
For Example
public class Student
{
public string FullName { get;set; }
public string Email { get; set; }
}
To valid an email you can use the EmailAddressAttribute class
Modify your code as the following
public class Student
{
public string FullName { get;set; }
[Required]
[Display(Name = "Email")]
[EmailAddress(ErrorMessage ="Your email is invalid !")]
public string Email { get; set; }
}
Don't forget include System.ComponentModel.DataAnnotations namespace.