コード例 #1
0
        public BaseTest()
        {
            DbContextOptionsBuilder <LogDatabaseContext> builderLog = new DbContextOptionsBuilder <LogDatabaseContext>();
            var connectionString = "server=localhost;userid=root;password=12345;database=Identity;";

            builderLog.UseMySql(connectionString);



            _logDatabaseContext = new LogDatabaseContext(builderLog.Options);

            LogSettings _logSettings = new LogSettings()
            {
                FileUploadFolderPath = "c:/"
            };
            IOptions <LogSettings> logOptions           = Options.Create(_logSettings);
            IHttpContextAccessor   iHttpContextAccessor = new HttpContextAccessor {
                HttpContext = new DefaultHttpContext()
            };

            _logCategoryService = new LogCategoryService(_logDatabaseContext, logOptions, iHttpContextAccessor);
            _logService         = new LogService(_logDatabaseContext, logOptions, iHttpContextAccessor);
            _logSchemaService   = new LogSchemaService(_logDatabaseContext, logOptions, iHttpContextAccessor);
        }
コード例 #2
0
 public LogService(LogDatabaseContext databaseContext, IOptions <LogSettings> logSettings, IHttpContextAccessor iHttpContextAccessor)
 {
     _logRepository = new StatusRepository(databaseContext, logSettings, iHttpContextAccessor);
 }