I have a situation where I am getting an unexpected duplicate row in my collection. I have the following tables (simplified):
Organization
...OrgID int
AppUser
...UserID int
...OrgID int
Each user is in one organization. I am using the SelfServicing templates. Here is the senario I wanted to use:
//Create an AppUser object (inherited from AppUserEntity)
AppUser user = new AppUser(1);
//Get collection of available users
AppUserCollection userAvailable = user.Organization.AppUser;
This should give me a list of all users in the current user's (ID=1) organization. It does, except it repeats the current user. Using SQLProfiler I see that the SQL is correct and does not return a duplicate row.
If I do the following (not using inherited class) everything works fine:
//Create an AppUserEntity object
AppUserEntity user = new AppUserEntity(1);
//Get collection of available users
AppUserCollection userAvailable = user.Organization.AppUser;
In either case I end up getting my AppUser Collection from an OrganizationEntity object so I don't understand why I get different results. This is not an emergency since the work around works fine. Thanks.
-Bill Shuman