public async Task <IList <Document> > TranslateAsync(QueryResponse queryResponse) { var result = new List <Document>(); var messageDescriptors = queryResponse.ToMessageDescriptors(); foreach (var messageDescriptor in messageDescriptors) { var messageParse = _messageParseFactory.Create <IList <Document> >(messageDescriptor.Type); var documents = await messageParse.ParseAsync(queryResponse, messageDescriptor); result.AddRange(documents); } return(result); }
public async Task <IList <Activity> > TranslateAsync(QueryResponse queryResponse, Activity activity) { var result = new List <Activity>(); var messageDescriptors = queryResponse.ToMessageDescriptors(); foreach (var messageDescriptor in messageDescriptors) { var messageParse = _messageParseFactory.Create <IList <Activity> >(messageDescriptor.Type); var activities = await messageParse.ParseAsync(queryResponse, messageDescriptor); CreateReply(activity, activities); result.AddRange(activities); } return(result); }