@@ -69,7 +69,7 @@ protected virtual void OnScriptFileChanged(object sender, FileSystemEventArgs e)
6969
7070 protected static Dictionary < string , string > GetBindingData ( object value , IBinder binder , Collection < FunctionBinding > inputBindings , Collection < FunctionBinding > outputBindings )
7171 {
72- Dictionary < string , string > bindingData = new Dictionary < string , string > ( ) ;
72+ Dictionary < string , string > bindingData = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
7373
7474 // If there are any parameters in the bindings,
7575 // get the binding data. In dynamic script cases we need
@@ -79,7 +79,8 @@ protected static Dictionary<string, string> GetBindingData(object value, IBinder
7979 if ( outputBindings . Any ( p => p . HasBindingParameters ) ||
8080 inputBindings . Any ( p => p . HasBindingParameters ) )
8181 {
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
8384 ApplyAmbientBindingData ( binder , bindingData ) ;
8485
8586 try
@@ -90,9 +91,20 @@ protected static Dictionary<string, string> GetBindingData(object value, IBinder
9091 // parse the object skipping any nested objects (binding data
9192 // only includes top level properties)
9293 JObject parsed = JObject . Parse ( json ) ;
93- bindingData = parsed . Children < JProperty > ( )
94+ var additionalBindingData = parsed . Children < JProperty > ( )
9495 . Where ( p => p . Value . Type != JTokenType . Object )
9596 . 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+ }
96108 }
97109 }
98110 catch
0 commit comments