@@ -69,7 +69,7 @@ protected virtual void OnScriptFileChanged(object sender, FileSystemEventArgs e)
69
69
70
70
protected static Dictionary < string , string > GetBindingData ( object value , IBinder binder , Collection < FunctionBinding > inputBindings , Collection < FunctionBinding > outputBindings )
71
71
{
72
- Dictionary < string , string > bindingData = new Dictionary < string , string > ( ) ;
72
+ Dictionary < string , string > bindingData = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
73
73
74
74
// If there are any parameters in the bindings,
75
75
// get the binding data. In dynamic script cases we need
@@ -79,7 +79,8 @@ protected static Dictionary<string, string> GetBindingData(object value, IBinder
79
79
if ( outputBindings . Any ( p => p . HasBindingParameters ) ||
80
80
inputBindings . Any ( p => p . HasBindingParameters ) )
81
81
{
82
- // first apply any existing binding data
82
+ // First apply any existing binding data. Any additional binding
83
+ // data coming from the message will take precedence
83
84
ApplyAmbientBindingData ( binder , bindingData ) ;
84
85
85
86
try
@@ -90,9 +91,20 @@ protected static Dictionary<string, string> GetBindingData(object value, IBinder
90
91
// parse the object skipping any nested objects (binding data
91
92
// only includes top level properties)
92
93
JObject parsed = JObject . Parse ( json ) ;
93
- bindingData = parsed . Children < JProperty > ( )
94
+ var additionalBindingData = parsed . Children < JProperty > ( )
94
95
. Where ( p => p . Value . Type != JTokenType . Object )
95
96
. ToDictionary ( p => p . Name , p => ( string ) p ) ;
97
+
98
+ if ( additionalBindingData != null )
99
+ {
100
+ foreach ( var item in additionalBindingData )
101
+ {
102
+ if ( item . Value != null )
103
+ {
104
+ bindingData [ item . Key ] = item . Value . ToString ( ) ;
105
+ }
106
+ }
107
+ }
96
108
}
97
109
}
98
110
catch
0 commit comments