Page 1 of 1

Fluent Mappings Bug ??

Posted: Tue 08 Jan 2013 18:57
by jamesklett
I generated my model from my existing database, used the Fluent template, at am getting all these errors on the Map .Defaults columns. I have this problem on all of my properties, and that's is a lot.

here is one instance of what is generated

Map(x => x.Comment)
.Column("comment")
.CustomType("String")
.Access.Property()
.Generated.Never()
.Default("create default [D_STRING_EMPTY] as ''
")

.CustomSqlType("varchar")
.Not.Nullable()
.Length(254);


Notice the line in blue, the Fluent template is reading my databaseand placing all my DEFAULT's, that I have defined in SQL Server into the .Default as a string, which is a big problem, because I don't want the default value to be that. Secondly, notice that the string is split on two lines. Compile will not allow a string split across multiple lines.

So, I hope there is a fix or this is not going to work for me. I cant just fix all the code as it is thousands of lines like this

thanks again

JAMES

Re: Fluent Mappings Bug ??

Posted: Thu 10 Jan 2013 16:26
by Shalex
Please send us the following information:
1) the DDL script of your table;
2) the version of your SQL Server;
3) the version of your Entity Developer. Have you tried the latest (5.0.9) build?

Re: Fluent Mappings Bug ??

Posted: Thu 10 Jan 2013 17:14
by jamesklett
SQL Server 2012.

Entity Designer 5.0.9


below is the DDL for the default,.

Just do this, create a default in SQL Server like so

CREATE DEFAULT [dbo].[D_STRING_EMPTY]
AS
''

GO

and set that on a varchar column. that's all you should need to do

Re: Fluent Mappings Bug ??

Posted: Tue 15 Jan 2013 12:07
by Shalex
We have reproduced the problem and are working on it.

Re: Fluent Mappings Bug ??

Posted: Tue 15 Jan 2013 18:00
by Shalex
The bug with generating fluent mapping code for the property with a default value, which is created in the database via CREATE DEFAULT statement, is fixed. We will post here when the corresponding build of Entity Developer is available for download.

Re: Fluent Mappings Bug ??

Posted: Thu 17 Jan 2013 17:42
by Shalex
New build of Entity Developer 5.0.28 is available!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=25671.