Last active
October 27, 2017 10:44
-
-
Save yuka1984/2cfa9672d54264f99134ecce7e1a9583 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Task<ITriggerData> BindAsync(object value, ValueBindingContext context) | |
{ | |
if (value is SlackMessage) | |
{ | |
var bindingData = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase) | |
{ | |
{"data", value} | |
}; | |
object argument; | |
if (_parameter.ParameterType == typeof(string)) | |
argument = JsonConvert.SerializeObject(value, Formatting.Indented); | |
else | |
argument = value; | |
IValueBinder valueBinder = new SlackMessageValueBinder(_parameter, argument); | |
return Task.FromResult<ITriggerData>(new TriggerData(valueBinder, bindingData)); | |
} | |
throw new Exception(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment