Fluent Mappings Bug ??

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
jamesklett
Posts: 7
Joined: Tue 08 Jan 2013 17:42

Fluent Mappings Bug ??

Post by jamesklett » Tue 08 Jan 2013 18:57

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

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Fluent Mappings Bug ??

Post by Shalex » Thu 10 Jan 2013 16:26

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?

jamesklett
Posts: 7
Joined: Tue 08 Jan 2013 17:42

Re: Fluent Mappings Bug ??

Post by jamesklett » Thu 10 Jan 2013 17:14

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

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Fluent Mappings Bug ??

Post by Shalex » Tue 15 Jan 2013 12:07

We have reproduced the problem and are working on it.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Fluent Mappings Bug ??

Post by Shalex » Tue 15 Jan 2013 18:00

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.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Fluent Mappings Bug ??

Post by Shalex » Thu 17 Jan 2013 17:42

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.

Post Reply