示例#1
0
        static void getElement(object tag)
        {
            DB_repository.Tag tagFilter = (DB_repository.Tag)tag;
            FilterDefinition <DB_repository.Tag> filter = Builders <DB_repository.Tag> .Filter.Eq("tag_label", tagFilter.Tag_label);

            var result = imongointerface.GEtSpecificDocument(filter);

            Console.WriteLine(result.Id + " " + result.Tag_id + " " + result.Tag_label + " " + result.Tag_time.ToLongTimeString());
        }
示例#2
0
        public void threadAdd(object tag)
        {
            IMongo_List         ilistDB   = new MongoDB_List();
            IConnectMongoClient imongoCon = new ConnectMongoClient();

            imongointerface = new MongoInterfaceClass <DB_repository.Tag>();
            itag            = new Tag_services();
            itag.addData((DB_repository.Tag)tag);
            imongointerface.InsertOne(itag.getData());
            addingTag = itag.getData();
        }
示例#3
0
        public object createTag()
        {
            IGeneratorId igenId = new GenerateId();

            DB_repository.Tag tag = new DB_repository.Tag()
            {
                Id        = ObjectId.GenerateNewId().ToString(),
                Tag_id    = igenId.generateTagId(),
                Tag_label = igenId.generateLabel(),
                Tag_time  = DateTime.Now.ToUniversalTime()
            };
            return(tag);
        }