I have the following POCO:
Public Class T1
<Required()>
<MaxLength(128)>
<Key(), Column(Order:=0)>
Property K1 As String
<Required()>
<MaxLength(128)>
<Key(), Column(Order:=1)>
Property K2 As String
<Required()>
Property C1 As String
Property C2 As String
end Class
I would expect C2 to be created as Nullable, but both C1 and C2 are Not Null. Adding
<Required(AllowEmptyStrings:=True)>
Does not make a difference, as it seems the decoration is aimed at data validation, not DB creation.
So how do i get a nullable column with Code First?