using DG.EntityFramework; 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; using Zxd.Entity.Action; namespace Zxd.EntityFramework { public class CrmCloudDbContext : DbContext { public CrmCloudDbContext(DbContextOptions 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 EmployeeDepartmentDetail { get; set; } public DbSet EmployeeDepartment { get; set; } public DbSet CustomerBehaviorLog { get; set; } public DbSet EmployeeTodoitem { get; set; } public DbSet EmployeeDepartmentFull { get; set; } public DbSet Department { get; set; } } }