コード例 #1
0
        public async Task UploadBaseData()
        {
            var directory = new DirectoryInfo(@"C:\temp\Data\");
            var files     = directory.GetFiles("*.json");

            foreach (var file in files)
            {
                var json = File.ReadAllText(file.FullName);
                await _mongoDbRepo.UpsertJsonToCollection("Test", Path.GetFileNameWithoutExtension(file.FullName), json);
            }
        }
コード例 #2
0
        public async Task <bool> UpsertDocument(DocumentModelDto documentModelDto)
        {
            var json = Newtonsoft.Json.JsonConvert.SerializeObject(documentModelDto.Json);

            return(await _repository.UpsertJsonToCollection(documentModelDto.CollectionName, documentModelDto.DocumentId, json));
        }