41 lines
1.5 KiB
C#
41 lines
1.5 KiB
C#
using DG.EntityFramework;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Zxd.EntityFramework
|
|
{
|
|
public class CompanyBaseConfDbContext : DbContext
|
|
{
|
|
public CompanyBaseConfDbContext(DbContextOptions<CompanyBaseConfDbContext> 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);
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
|
|
public DbSet<DepartmentCrmconf> DepartmentCrmconf { get; set; }
|
|
public DbSet<Zxd.Entity.CompanyBaseConf.EmployeeDepartmentDetail> EmployeeDepartmentDetail { get; set; }
|
|
public DbSet<Zxd.Entity.CompanyBaseConf.EmployeeDepartment> EmployeeDepartment { get; set; }
|
|
public DbSet<Zxd.Entity.CompanyBaseConf.Application> Application { get; set; }
|
|
public DbSet<Zxd.Entity.CompanyBaseConf.ApplicationDepartment> ApplicationDepartment { get; set; }
|
|
|
|
public DbSet<Zxd.Entity.CompanyBaseConf.Employee> Employee { get; set; }
|
|
|
|
public DbSet<Entity.CompanyBaseConf.Department> Department { get; set; }
|
|
}
|
|
}
|