52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
using Hg.Core.Entity;
|
|
using Hg.Core.Entity.Hgaction;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Diagnostics;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Hg.Core.EntityFramework
|
|
{
|
|
public class HgAtionDbContext : DbContext
|
|
{
|
|
public HgAtionDbContext(DbContextOptions<HgAtionDbContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
|
|
{
|
|
var loggerFactory = new LoggerFactory();
|
|
loggerFactory.AddProvider(new EFLoggerProvider());
|
|
optionsBuilder.UseLoggerFactory(loggerFactory);
|
|
}
|
|
optionsBuilder.ConfigureWarnings(b => b.Ignore(CoreEventId.ContextInitialized));
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
}
|
|
|
|
public DbSet<ComplaintLog> ComplaintLog { get; set; }
|
|
|
|
public DbSet<ComplaintUserDept> ComplaintUserDept { get; set; }
|
|
|
|
public DbSet<ComplaintUserFollow> ComplaintUserFollow { get; set; }
|
|
|
|
public DbSet<ComplaintUser> ComplaintUser { get; set; }
|
|
|
|
public DbSet<LiveAudit> LiveAudit { get; set; }
|
|
|
|
public DbSet<LiveAuditLog> LiveAuditLog { get; set; }
|
|
|
|
public DbSet<LiveInfo> LiveInfo { get; set; }
|
|
}
|
|
} |