Esempio n. 1
0
        public async void Add(AddLogInput input)
        {
            if (input == null)
            {
                Logger.LogError($"{nameof(input)} should not be null.");
                return;
            }

            if (string.IsNullOrEmpty(input.Identity) || input.LogInfo == null)
            {
                return;
            }
            var client     = new MongoClient(Configuration.LogMongoConnectionString);
            var database   = client.GetDatabase("dotnetspider");
            var collection = database.GetCollection <BsonDocument>(input.Identity);
            await collection.InsertOneAsync(BsonDocument.Parse(input.LogInfo.ToString()));
        }
 public IActionResult Create([FromBody] AddLogInput input)
 {
     _logAppService.Add(input);
     return(Success());
 }