Hi,
i noticed that default values in ssdl property element is not taken into account when generating the script for database creation CreateDatabaseScript.
For example starting with this entity (ssdl)
Is this the expected behavior?
P.S. This behavior has been verified on both EF5 & EF6.
Regards, Max
i noticed that default values in ssdl property element is not taken into account when generating the script for database creation CreateDatabaseScript.
For example starting with this entity (ssdl)
<EntityType Name="Entity2Set">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Value" Type="nvarchar(max)" Nullable="true" DefaultValue="1" />
</EntityType>
I would expect a create table sql statement looking like this-- Creating table 'Entity2Set'
CREATE TABLE [dbo].[Entity2Set] (
[Id] int IDENTITY(1,1) NOT NULL,
[Value] nvarchar(max) NULL default '1'
);
GO
What EF generates is:-- Creating table 'Entity2Set'
CREATE TABLE [dbo].[Entity2Set] (
[Id] int IDENTITY(1,1) NOT NULL,
[Value] nvarchar(max) NULL
);
GO
Note there isn't the default value on column [value].Is this the expected behavior?
P.S. This behavior has been verified on both EF5 & EF6.
Regards, Max