I’m having a database computed field in my Code-First model. I’ve marked that with the DatabaseGeneratedAttribute. Do I need to specify the RequiredAttribute too?
In other words: Does ‘required’ mean, that it’s required this value is assigned to? Or does it mean, that this value is not allowed to be null.
RequiredAttributeis used for both validation and mapping definition. If you definestringproperty without this attribute it is defined as nullable column in the database but with this attribute it is not nullabe. In other words it says if property can containnullboth during validation and in the database.