I am sorry for the inconvenience that you have experienced.
The issue that you have described is a newly reported bug that we are considering as serious fault and we will do our best to fix it for the up-coming Q1 2014 release.
Until the fix is available you can use the following work around to stop join-table records from being cleared:
- Extend your concrete repository with a partial class. You should do that for any entity type that has many-to-many association(s). In your scenario at least UsersRepository and ClaimsRepository should be extended.
- Override the Update(...) method in the new partial code file in the following manner:
User Update(User entity)
// load the target entity from database
User loadedEntity = dataContext.GetAll<User>().FirstOrDefault(entity.UserId);
"Could not load user with the same ID"
// manually apply the same changes to the loaded one
loadedEntity.UserName = entity.UserName;
loadedEntity.Password = entity.Password;
// TODO: set all relevant properties;
// do not set the Many-To-Many property unless you did some changes there!
// persist the changes in loadedEntity
// return a detached copy back to the client
User detachedEntity = dataContext.CreateDetachedCopy(loadedEntity, fetchStrategy);
This work around will remove the issue with the Many-to-Many association, but is hard to maintain if you make modifications to the entity types that is handled by the controller and you have to manually code the setting of values from one instance to the other.
I will make sure to notify you as soon as the build with the fix for this issue is publicly available so you can get back to the out of the box implementation of the repository.
As a small compensation for the inconvenience and as recognition of reporting a new issue with our product I am adding 500 Telerik points to your account.
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features
shipped with our latest release!