One To One associations not generating as expected

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
thinkzig
Posts: 7
Joined: Mon 25 May 2009 19:51

One To One associations not generating as expected

Post by thinkzig » Wed 27 May 2009 19:53

I'm trying to model the association between two mySQL membership provider tables and a proprietary User table of my own creation.

The tables in question are

My_Aspnet_Users (PK = userId)
My_Aspnet_Membership (PK = id)
User (PK = userId)

All 3 tables have a primary key of userId or id, and all 3 primary keys should be logically related, though there are no FK relationships specified for them in the db schema.

I've renamed the tables in the entity developer as such

My_Aspnet_Users => User
My_Aspnet_Membership => Membership
User => Profile

I've set up 1-to-1 associations in the ED editor between User and Membership and User and Profile with User being the parent in each one.

I'd like to be able to use the resulting classes like this

User.Membership.Email = "blah";

or

User.Profile.SomeProperty = 1;

but the Entity Developer keeps generating the classes such that User.Membership and User.Profile are EntitySet and EntitySet respectively.

Since I'm specifying these as 1-to-1 associations, shouldn't the properties be of type EntityRef and EntityRef? The way they are currently being generated, I have to set properties like this...

User.Membershipl[0].Email = "blah";

or

User.Profilel[0].SomeProperty = 1;

... which I'd rather not do. These are 1-to-1 relationships and I shouldn't have to specify the index each time.

Am I doing something wrong?

EDIT: Forgot to add that I'm using version 2.0.21 and that the keys I'm associating between all involved entities are all marked as the PK.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 28 May 2009 10:23

Thank you for your inquiry, this problem was already found.
I will let you know about the results of our investigation.

thinkzig
Posts: 7
Joined: Mon 25 May 2009 19:51

Post by thinkzig » Thu 09 Jul 2009 19:22

Any update on this? The designer seems to just not work with 1-to-1 relationships. I'm having to code them myself with partial classes.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 10 Jul 2009 08:05

This problem is not fixed yet. Sorry for inconvenience.
I will let you know as soon as it is fixed.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 09 Feb 2010 14:58

We have fixed the problem.

Post Reply