Skip to content

SharedLocalizationBehavior class

namespace: Serenity.Services   assembly: Serenity.Net.Services

Behavior for the rows with a SharedLocalizationAttribute, whose translations are in the shared DataTranslationTable: returns them on retrieve when the request includes the "Localizations" column, saves the ones in SaveRequest.Localizations, and removes them when a record is deleted, unless it is soft deleted.

public class SharedLocalizationBehavior : BaseSaveDeleteBehaviorAsync, IDeleteBehaviorSync, 
    IImplicitBehavior, IRetrieveBehaviorAsync, IRetrieveBehaviorSync, ISaveBehaviorSync
parameter description
userEntityOptions The options of the user row, for the type of the user ID that changed a translation, or null for an integer ID.
timeProvider The clock, or null for the system one.

Public Members

name description
SharedLocalizationBehavior(…) Behavior for the rows with a SharedLocalizationAttribute, whose translations are in the shared DataTranslationTable: returns them on retrieve when the request includes the "Localizations" column, saves the ones in SaveRequest.Localizations, and removes them when a record is deleted, unless it is soft deleted.
ActivateFor(…)
virtual OnAfterSave(…)
override OnAfterSaveAsync(…)
virtual OnBeforeDelete(…)
override OnBeforeDeleteAsync(…)
virtual OnReturn(…)
virtual OnReturnAsync(…)

Protected Members

name description
virtual GetAudit(…) Gets who changes the translations and when.
virtual IsFieldEditable(…) Determines whether the field may be edited by the current user for the current operation, like the save handler does. A translation is only saved for such a field, so that the field permissions can't be bypassed by sending values under SaveRequest.Localizations.

See Also