Executing the following block of code to write values to object properties using 'Unit Of Work':
Trace: VI.Base.ViException: Values in read-only objects cannot be set.
at VI.DB.Entities.ReadOnlyEntityColumnIndexedImpl.SetValueAsync(Object value, SetValueBehavior behavior, CancellationToken cancellationToken)
However the same object property can be modified via Object Browser without causing any error.
The "GetCollection" function is missing a "EntityCollectionLoadType.Bulk " parameter.
This parameter is required for 'Unit Of Work' (UOW). This can also be referenced in One Identity Manager's OOTB Scripts which are using UOW.
The above sample code should be changed to the following: