예제 #1
0
        public async Task <IActionResult> GetAll()
        {
            var getLogEntriesQuery = new GetAllLogEntriesQuery();
            var logEntries         = await mediator.Send(getLogEntriesQuery);

            return(Ok(logEntries));
        }
예제 #2
0
        public async Task <IEnumerable <WebAppLogEntry> > Handle(GetAllLogEntriesQuery message)
        {
            var mongoClient = new MongoClient(storageConfig.ConnectionString);
            var database    = mongoClient.GetDatabase(storageConfig.IISDataStorage.DbName);

            return(await database
                   .GetCollection <WebAppLogEntry>(storageConfig.IISDataStorage.WebAppDataCollection)
                   .Find(new BsonDocument()).ToListAsync());
        }