A table with a column having a nullable uniqueidentifier with a default value NULL:
[MyColumn] UNIQUEIDENTIFIER CONSTRAINT [DF_MyColumn] DEFAULT (NULL) NULL
will result in a Poco having the following line in the constructor:
MyColumn = Guid.Parse("NULL");
This will generate an exception.
The problem seems to be in the "CleanUpDefault" method (EF.Reverse.POCO.Core.ttinclude).
I was able to work around this thank to the new "UpdateColumn" function, but I think this should be fixed in the ttinclude.
Here's the workaround just in case:
UpdateColumn = (Column column, Table table) =>
{
if (column.PropertyType.ToLower() == "guid" && column.IsNullable && column.Default.ToLower().Contains("parse(\"null\")"))
{
column.Default = "null";
}
return column;
};
Comments: Released in v2.12.2
[MyColumn] UNIQUEIDENTIFIER CONSTRAINT [DF_MyColumn] DEFAULT (NULL) NULL
will result in a Poco having the following line in the constructor:
MyColumn = Guid.Parse("NULL");
This will generate an exception.
The problem seems to be in the "CleanUpDefault" method (EF.Reverse.POCO.Core.ttinclude).
I was able to work around this thank to the new "UpdateColumn" function, but I think this should be fixed in the ttinclude.
Here's the workaround just in case:
UpdateColumn = (Column column, Table table) =>
{
if (column.PropertyType.ToLower() == "guid" && column.IsNullable && column.Default.ToLower().Contains("parse(\"null\")"))
{
column.Default = "null";
}
return column;
};
Comments: Released in v2.12.2