I am using Entity Framework 4.1 with a coded first model. A common example is that many objects refer to the user who owns them, for example.
public class Item { public User Owner { get; set; } }
This creates a column with a null value in the database, but since each item must have an owner, I want the column to be marked NOT NULL. If I use the [Required] attribute, then submitting the form to create the element results in an error. This field is never set through the form, only manually in the code.
source share