Hello,
I'm not able to do the following:
I have a (FireBird) table User, table Right and a crosstable UserRight.
I want to create a new user and at the same time give him rights. I want to persist this to the database in one go. The way described below gives me an exception that I need to provide the new PK-value of User. I hoped this was all taken care of in the framework. Or am I doing something wrong?
UserEntity usr = new UserEntity();
usr.Name = "test";
usr.active = 1;
UserRightEntity usrRight = new UserRightEntity();
usrRight.User = usr;
usrRight.Right = new RightEntity(1); //1=PK value for Right
usr.Save(true);
Greetz,
zaad