コード例 #1
0
 /// <summary>
 /// Constructor of NLPController
 /// </summary>
 /// <param name="nlpService">
 /// NLP service
 /// </param>
 /// <param name="fileService">
 /// File service
 /// </param>
 /// <param name="azureOptionsMonitor">
 /// Azure Blob Storage configuration
 /// </param>
 /// <param name="mongoFileService">
 /// Mongo service
 /// </param>
 public NLPController(INLPService nlpService, IFileService fileService, IOptionsMonitor <AzureBlobStorageConfig> azureOptionsMonitor, MongoFileService mongoFileService)
 {
     _nlpService             = nlpService;
     _fileService            = fileService;
     _azureBlobStorageConfig = azureOptionsMonitor.CurrentValue;
     _mongoFileService       = mongoFileService;
 }
コード例 #2
0
 /// <summary>
 /// Constructor of AnalysisController
 /// </summary>
 /// <param name="publisherService">
 /// Publisher service interface
 /// </param>
 /// <param name="fileService">
 /// File service interface
 /// </param>
 /// <param name="analysisService">
 /// Analysis interface
 /// </param>
 /// <param name="azureOptionsMonitor">
 /// Azure options
 /// </param>
 /// <param name="mongoFileService">
 /// Mongo service interface
 /// </param>
 /// <param name="rabbitOptionsMonitor">
 /// RabbitMQ options
 /// </param>
 public AnalysisController(PublisherService publisherService, IFileService fileService, IAnalysisService analysisService, IOptionsMonitor <AzureBlobStorageConfig> azureOptionsMonitor, MongoFileService mongoFileService, IOptionsMonitor <RabbitMQConfig> rabbitOptionsMonitor)
 {
     _publisherService       = publisherService;
     _fileService            = fileService;
     _analysisService        = analysisService;
     _azureBlobStorageConfig = azureOptionsMonitor.CurrentValue;
     _mongoFileService       = mongoFileService;
     _rabbitMQConfig         = rabbitOptionsMonitor.CurrentValue;
 }
コード例 #3
0
        /// <summary>
        /// Main method
        /// </summary>
        /// <param name="args">
        /// Arguments of the application
        /// </param>
        static void Main(string[] args)
        {
            Config config = ReadConfig();

            _context          = new DocumentAnalyzerDBContext(config.SqlConnection);
            _employeeService  = new EmployeeService(_context);
            _mongoFileService = new MongoFileService(config.MongoConnectionString, config.MongoDatabaseName, config.MongoCollectionName);

            ReceiveFromQueue(config.HostName, config.QueueName);
            return;
        }
コード例 #4
0
        internal void SaveGetDelete(MongoFileService fs, IFileID id, string content, string actual)
        {
            GIVEN["a service instance"] = () => fs = new MongoFileService(Env.DB);

            When["saving a file"] = async() => id = await fs.Save(async stream => {
                using (var w = new StreamWriter(stream)) {
                    await w.WriteAsync(content = "file contents");
                    await w.FlushAsync();
                }
            });

            And["getting the file"] = () => fs.Get(id, async stream =>
                                                   actual = await new StreamReader(stream).ReadToEndAsync()
                                                   );

            THEN["the returned file equals the original"] = () => actual.Should().Be(content);

            When["deleting the file"] = () => fs.Delete(id);

            Then["getting the file", ThrowsA <FileNotFoundException>()] = () => fs.Get(id, s => Task.CompletedTask);
            And["deleting the file", ThrowsA <FileNotFoundException>()] = () => fs.Delete(id);
        }
コード例 #5
0
 /// <summary>
 /// Constructor of FileController
 /// </summary>
 /// <param name="fileService">
 /// File service
 /// </param>
 public FileController(IFileService fileService, MongoFileService mongoFileService)
 {
     _fileService      = fileService;
     _mongoFileService = mongoFileService;
 }
コード例 #6
0
 /// <summary>
 /// Constructor of the MongoController
 /// </summary>
 /// <param name="fileService">
 /// Monfo service
 /// </param>
 public MongoController(MongoFileService fileService)
 {
     _mongoFileService = fileService;
 }