public static void EncryptValue(this IEncryptionService encryptionService, WireEncryptedString wireEncryptedString, IOutgoingLogicalMessageContext context) { wireEncryptedString.EncryptedValue = encryptionService.Encrypt(wireEncryptedString.Value, context); wireEncryptedString.Value = null; }