Пример #1
0
        private static void CreateUnicasts(UnicastBusConfigDB unicastBusCfgDB)
        {
            var client = new MongoClient(ConnectionString);
            var server = client.GetServer();
            MongoDatabase myConfig = server.GetDatabase("MyConfig");

            MongoCollection<BsonDocument> unicasts = myConfig.GetCollection<BsonDocument>("UnicastBusConfigDB");
            BsonDocument unicast = new BsonDocument {
                        { "ForwardReceivedMessagesTo", unicastBusCfgDB.ForwardReceivedMessagesTo },
                        { "DistributorControlAddress", unicastBusCfgDB.DistributorControlAddress },
                        { "DistributorDataAddress", unicastBusCfgDB.DistributorDataAddress },
                        { "TimeoutManagerAddress", unicastBusCfgDB.TimeoutManagerAddress },
                        { "TimeToBeReceivedOnForwardedMessages", unicastBusCfgDB.TimeToBeReceivedOnForwardedMessages.ToString() }
                        };

            unicasts.Insert(unicast);
        }
Пример #2
0
 private static void CreateUnicasts()
 {
     UnicastBusConfigDB unicastBusCfgDB = new UnicastBusConfigDB();
     unicastBusCfgDB.ForwardReceivedMessagesTo = "MyAudits";
     CreateUnicasts(unicastBusCfgDB);
 }