Exemplo n.º 1
0
        public async Task delete(string id)
        {
            await coll.DeleteOneAsync(i => i.id == id);

            if (is_sync)
            {
                s_history document = new s_history()
                {
                    id = id, add = false, time = DateTime.Now
                };
                await history.ReplaceOneAsync(i => i.id == id, document);

                await notify.send(userid);
            }
        }
Exemplo n.º 2
0
        public async Task upsert(T val)
        {
            await coll.ReplaceOneAsync(i => i.id == val.id, val, new ReplaceOptions()
            {
                IsUpsert = true
            });

            if (is_sync)
            {
                s_history document = new s_history()
                {
                    id = val.id, add = true, time = DateTime.Now
                };
                await history.ReplaceOneAsync(i => i.id == val.id, document, new ReplaceOptions()
                {
                    IsUpsert = true
                });

                await notify.send(userid);
            }
        }