FK Property Name on Assocition

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
PatConnelly
Posts: 18
Joined: Fri 17 Jun 2005 14:15

FK Property Name on Assocition

Post by PatConnelly » Wed 09 Nov 2011 14:15

I have two classes Task and UserMaster.

The Task class needs two properties called CreateUser and UpdateUser, I would like to have these both be associated with UserMaster (Who's primary key is UserPK).

When I try to make the first association, a FK property is added to Task called UserPK. If I rename this to CreateUser, I get the following error:

Code: Select all

Tracker.Task' does not contain a definition for 'UserPK' and no extension method 'UserPK' accepting a first argument of type 'Tracker.Task' could be found (are you missing a using directive or an assembly reference?)	
So I removed the association and tried:
add a CreateUser property to the Task class
In the Association Editor, deselect 'Add Foreign Key Properties...'
Choose the CreateUser property from the dropdown.

I get the same error. The generated code is:

Code: Select all

            modelBuilder.Entity()
                .HasRequired(p => p.UserMaster)
                    .WithMany(c => c.Tasks)
                .HasForeignKey(p => new { p.UserPK })
                    .WillCascadeOnDelete(false);


PatConnelly
Posts: 18
Joined: Fri 17 Jun 2005 14:15

Additional Info

Post by PatConnelly » Wed 09 Nov 2011 14:19

Oops, forgot to add:

Entity Developer 4.1.64 (running in VS 2010)
Entity Framework 4.2

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 14 Nov 2011 18:03

Thank you for the report, we have reproduced the issue. We will analyze it and inform you about the results as soon as possible.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 09 Dec 2011 17:06

We've fixed this issue. The fix is available in the new 4.2.85 version of Entity Developer, which can can be downloaded from
http://www.devart.com/entitydeveloper/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only).

For the detailed information about the fixes and improvements available in Entity Developer 4.2.85, please refer to
http://www.devart.com/forums/viewtopic.php?t=22845

Post Reply