private MongoDB.Bson.BsonDocument Aggrigate(MongoDB.Bson.BsonDocument _doc)
 {
     try
     {
         string   destinationValue = "";
         string[] sourceKeyArr     = SourceKeys.Split(',');
         foreach (string sourceKey in sourceKeyArr)
         {
             if (_doc[sourceKey] != null)
             {
                 if (this.SourceKeyTransformation.Key == sourceKey)
                 {
                     destinationValue += this.SourceKeyTransformation.Execute(_doc);
                 }
                 else
                 {
                     destinationValue += _doc[sourceKey] + Delimiter;
                 }
             }
         }
         if (destinationValue.EndsWith(Delimiter))
         {
             destinationValue = destinationValue.TrimEnd(Delimiter.ToCharArray());
         }
         _doc.Add(DestinationKey, destinationValue);
     }
     catch (Exception exp)
     {
         Console.WriteLine(exp.Message);
         throw;
     }
     return(_doc);
 }
Example #2
0
 public InputSource(List <Element> elements, params Keys[] keys)
 {
     SourceElements.AddRange(elements);
     SourceKeys.AddRange(keys);
 }
Example #3
0
 public InputSource(params Keys[] keys)
 {
     SourceKeys.AddRange(keys);
 }
Example #4
0
 public InputSource(Element element, Keys key)
 {
     SourceElements.Add(element);
     SourceKeys.Add(key);
 }
Example #5
0
 public InputSource(Keys key)
 {
     SourceKeys.Add(key);
 }