This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello! I'm running this code:
Problem is in UsersInRoles which is (I tryed previously List instead EntityCollection but there was error that method ToList is not supported):
Basically I want to get user profile from DB with all roles which he belongs. When I remove "UsersInRoles = user.UsersInRoles" everything works fine. Thanks |
|
|
I just only want to add small info: Users and UsersInRoles are two different tables which are connected with FK. In this part:
I want to retrieve all roles to which user belongs and place them in UsersInRoles which is type of List<UsersInRole> |
|
|
Hmm .. anyone? Any help will be appreciated |
|
|
Hi Webio, What you're doing should work - I've just created a similar case and had no issues. Could you provide a little more detail? A repro would be the most handy (if it's sensitive please send it to jd @ mindscape.co.nz). Apologies for the slow response time - everybody is back on board for 2009 on the 5th. Kind regards, John-Daniel |
|
|
Thanks for replying. I've just send you email with DB schema and sample webapp producing this error. Thanks |
|
|
Hi Webio, Thanks for the repro you emailed. I've replied via email but I will also answer here for anybody else who's hunting around our forums. Your UsersInRole table uses a composite key which LightSpeed does not support. LightSpeed will expect to see an ID field on the table which is used as the key. The reason you're getting an out of bounds exception is because internally LightSpeed models the entity as your two fields + an ID field. Because you don't have an ID field any time it iterates over the result set it will fail because it only finds two fields. To resolve the issue, add an ID field and remove the composite key. You can add unique validation either in the domain model or the database to ensure you're not getting duplicate rows (the same RoleId & UserId) if you desire this type of checking. I hope this helps, John-Daniel |
|
|
Issue fixed. Huge thanks |
|