protected override void Execute(IPluginContext context) { this.EnsureNotNull(context, nameof(context)); context.EnsureTargetLogicalName(GlobalSettingEntity.TypeName(_prefix)); var target = context .GetTargetEntity(); var image = context .GetEntityImage(EntityImageType.PreImage, throwIfNull: context.IsUpdateMessage()); var type = target .GetAttributeValue <OptionSetValue>(GlobalSettingEntity.TypeFieldName(_prefix), image)? .ToEnum <GlobalSettingType>() ?? GlobalSettingType.String; var value = target .GetAttributeValue <String>(GlobalSettingEntity.ValueFieldName(_prefix), image); ValidateValue(type, value); SanitizeValue(target, type, value); }