#if DEBUG // 以下、LoggerFactory の構築方法が v.2.x 以前と異なる。 var loggerFactory = LoggerFactory.Create(builder => { builder.AddFilter( category: DbLoggerCategory.Database.Command.Name, level: LogLevel.Debug); }); var option = new DbContextOptionsBuilder<db1Context>() .UseLoggerFactory(loggerFactory) .Options; using (var db = new db1Context(option)) #else using (var db = new db1Context()) #endif
Thanks!