Services/PublicService/Infrastructure/EfDataAccess/DbContext.cs
(完整代码) 878Busing Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using System;
using System.Collections.Generic;
using System.Text;
namespace Infrastructure.EfDataAccess
{
public class EfDbContext : DbContext
{
public EfDbContext(DbContextOptions<EfDbContext> options) : base(options)
{
}
//Dbset<Po>
public DbSet<PersistenceObject.MallSetting> MallSetting { get; set; }
public DbSet<PersistenceObject.EventHandleErrorInfo> EventHandleErrorInfo { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
//启用Guid主键类型扩展
modelBuilder.HasPostgresExtension("uuid-ossp");
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
base.OnModelCreating(modelBuilder);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
