Interop Migration
Raising an Intent
Intents now support a cleaner way of initialising the Intent payload object.
var interopClient = await runtime.Interop.ConnectAsync("the-broker");
var intent = JsonConvert.DeserializeObject<Intent>(@$"{{
'name': 'StartCall',
'context': {{
'type': 'fdc3.contact',
'name': 'Andy',
'id': {{
'email': 'andy@hisemail.com'
}}
}}
}}");
var result = await interopClient.FireIntentAsync(intent);
Setting a Context
The Context payload object is now easily settable and does not require either a Json deserialize or inheritence work to set.
var interopClient = await runtime.Interop.ConnectAsync("the-broker");
await interopClient.JoinContextGroupAsync("green");
var contactContext = JsonConvert.DeserializeObject<Context>(@$"{{
'type': 'fdc3.contact',
'name': 'Andy',
'id': {{
'email': 'andy@hisemail.com'
}}
}}");
var result = await interopClient.FireIntentAsync(intent);