/// <summary> Sends a bson document as a JSON string. </summary> /// /// <remarks> Vasko, 13-Dec-17. </remarks> /// /// <param name="doc"> The document. </param> public void SendDocument(IntegratedDocument doc) { //Normalize the data, then send it var data = doc.Document.ToJson().ToString(); SendMessage(data); }
/// <summary> /// /// </summary> /// <returns></returns> public IEnumerable <IntegratedDocument> AsEnumerable() { var iter = Source.GetIterator(); foreach (var element in iter) { var doc = new IntegratedDocument(); doc.SetDocument(element); doc.IntegrationId = Definition.Id; yield return(doc); } }
public IIntegratedDocument CreateDocument <T>(T data) { var doc = new IntegratedDocument(); doc.SetDocument(data); doc.IntegrationId = Id; if (this.APIKey != null) { doc.APIId = this.APIKey.Id; } return(doc); }