/// <summary> /// Applies all relevant Conversation related identifies to an activity. This effectivly /// couples a blank Activity to a conversation. /// </summary> /// <param name="activity">The activity to update. Existing values in the Activity will be overwritten.</param> /// <param name="reference">The ConversationReference from which to pull the relevant conversation information</param> /// <remarks> /// This method applies the following values from ConversationReference: /// ChannelId /// ServiceUrl /// Conversation /// Bot (assigned to the .From property on the Activity) /// User (assigned to the .Recipient on the Activity) /// ActivityId (assigned as the ReplyToId on the Activity) /// </remarks> public static void ApplyConversationReference(IActivity activity, ConversationReference reference) { BotAssert.ActivityNotNull(activity); BotAssert.ConversationReferenceNotNull(reference); activity.ChannelId = reference.ChannelId; activity.ServiceUrl = reference.ServiceUrl; activity.Conversation = reference.Conversation; activity.From = reference.Bot; activity.Recipient = reference.User; activity.ReplyToId = reference.ActivityId; }