In SelfServicing:
When saving an entity, it will be refetched automatically if one of its fields were accessed.
The following is from the docs.
Setting the EntityState to Fetched automatically after a save
By design an entity which was successfully saved to the database gets as EntityState OutOfSync. The LLBLGen Pro runtime framework will refetch an entity which is marked OutOfSync automatically right before an entity field's property is read. This is done to make sure that default constraints, calculated fields and elements which could have been changed after the save action inside the database (for example because a database trigger ran after the save action) are reflected in the entity after the save action. If you know that this won't happen in your application, you can get a performance gain by specifying that LLBLGen Pro should mark a successfully saved entity as Fetched instead of OutOfSync. In this situation, LLBLGen Pro won't perform a fetch action to obtain the new entity values from the database.
To use this feature, you've to set the static/Shared property EntityBase.MarkSavedEntitiesAsFetched to true (default is false). This will be used for all entities in your application, so if you have some entities which have to be fetched after the update (for example because they have a timestamp field), you should keep the default, false. You can also set this value using the config file of your application by adding the following line to the appSettings section of your application's config file:
<add key="markSavedEntitiesAsFetched" value="true"/>
If you want to make sure refetches are done upfront. Then you should fetch the entities again into a new collection.
i.e.
- if you were updating an existing collection, use the same means (filters) you did to load it the first time, to reload it again.
- If you were inserting new entities, then you can collect the PK values of the inserted entities, and use them as a range predicate to fetch the entities.