Hello Ali Kolahdoozan,
After having a closer look at your first post we noticed that you mention System.Nullable
generates the nullable properties in the form int?
, etc. In fact, System.Nullable<int>
are interchangeable and they refer to one and the same struct. Have a look at the following article
. Is this where your concerns come from? As explained in the article there are two alternatives to declaring nullable fields and LinqToSql
use different ones. Or are there any properties for which you have noticed a mismatch between the database nullability and the property type nullability? If there are any discrepancies you have noticed, we would kindly ask you to give us an example so that we can further investigate. A sample table definition would be enough.
You should not worry about the mapped String
properties which have their Nullable
attribute set to false. The Nullable
attribute can be viewed by selecting a property in the entity diagram and pressing F4. The Nullable
attribute is interpreted in the code generation process so that we generate properties such as nullable ints (int?
). As we mentioned, the String
type is one that accepts null values and you cannot declare a Nullable<string>
type as this results in a compilation error. In LinqToSql
attribute for the mapped properties reflects the nullability in the database. With OpenAccess
you can check the nullability of the mapped columns in the Model Schema Explorer
when you select a concrete column and browse its properties by pressing F4. The nullable columns have their IsNullable
attribute set to true. Furthermore, the Table Editor
provides additional control over the null values for a column. With the help of this editor you can change and view different options for the mapped tables.
Should you have any other questions, feel free to contact us.
the Telerik team