When applied to a property of a domain class, the database will create a NOT NULL column.
using System.ComponentModel.DataAnnotations;
public class Person
{
public int PersonID { get; set; }
[Required]
public string PersonName { get; set; }
}
The resulting column with the NOT NULL constraint:
Note: It can also be used with asp.net-mvc as a validation attribute.