| | |
| | | using FlexJobApi.Core; |
| | | using Furion; |
| | | using Furion.DatabaseAccessor; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore.Diagnostics; |
| | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | using Microsoft.Extensions.Configuration; |
| | | using System; |
| | | |
| | | namespace FlexJobApi.EntityFramework.Core; |
| | |
| | | { |
| | | } |
| | | |
| | | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) |
| | | { |
| | | base.OnConfiguring(optionsBuilder); |
| | | optionsBuilder |
| | | .UseSqlServer(App.Configuration.GetConnectionString("FlexJobApiLog"), options => |
| | | { |
| | | // 指定目标数据库版本为SQL Server 2014 |
| | | options.UseCompatibilityLevel(120); // 120对应SQL Server 2014 |
| | | // 可选:设置批量操作大小(按需调整) |
| | | options.MaxBatchSize(1000); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnModelCreating(ModelBuilder modelBuilder) |
| | | { |
| | | base.OnModelCreating(modelBuilder); |