Esempio n. 1
0
        private async Task Insert(LoadCopay processData)
        {
            var            model = new CopayDetailModel(processData.Data.Split('|'));
            IMongoClient   client;
            IMongoDatabase database;

            client   = new MongoClient();
            database = client.GetDatabase("copay");

            var collection = database.GetCollection <CopayDetailModel>("copay");

            await collection.InsertOneAsync(model);
        }
Esempio n. 2
0
        public void Initialize()
        {
            //time to kick off the feed parsing process, and send the results to ourselves
            Receive <LoadCopay>(processData =>
            {
                //Insert(processData).Wait();
                var model = new CopayDetailModel(processData.Data.Split('|'));
                IMongoClient client;
                IMongoDatabase database;

                client   = new MongoClient();
                database = client.GetDatabase("copay");

                var collection = database.GetCollection <CopayDetailModel>("copay");

                collection.InsertOneAsync(model).PipeTo(Self,
                                                        Self,
                                                        () => { Console.WriteLine("Console WriteLine Copay Load data success"); return(null); },
                                                        ex => {
                    Console.WriteLine("Console WriteLine Copay Load data failure" + ex.Message); return(null);
                });
                SendMessage("Copay Load data " + processData.Data);
            });
        }