sunpengfei
2025-08-18 105716aa60b427cff818b984e74640dc94b053f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using FlexJobApi.Core;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
 
namespace FlexJobApi.EntityFramework.Core;
 
[AppDbContext("FlexJobApiLog", DbProvider.SqlServer)]
public class LogDbContext : AppDbContext<LogDbContext, LogDbContextLocator>
{
    public LogDbContext(DbContextOptions<LogDbContext> options) : base(options)
    {
    }
 
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        DbUtils.BuildEntity(modelBuilder, typeof(LogDbContextLocator)).Wait();
    }
 
    protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult<int> result)
    {
        DbUtils.SavingChangesEvent(eventData, result);
    }
}