WebAPI.Jwt.Swagger.Final\Long.EntityFrameworkCore\ApplicationDbContext.cs
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace Long.EntityFrameworkCore;
public class ApplicationDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
// 关闭ef core的命令行输出
optionsBuilder.LogTo(Console.WriteLine,LogLevel.Warning);
}
/// <summary>
/// 模型生成器
/// </summary>
/// <param name="modelBuilder"></param>
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
}