ABP vNext框架启用EF Core实体框架敏感数据记录
问题说明:
An exception was thrown while attempting to evaluate a LINQ query parameter expression. See the inner exception for more information. To show additional information call 'DbContextOptionsBuilder.EnableSensitiveDataLogging'.
EF Core实体框架执行Linq语句出现异常,为了方便跟踪问题,就需要启用日志来记录。
解决方案:
在ABP vNext框架下启用实体框架敏感数据记录详见下方代码:
参考:
Project.EntityFrameworkCore.ProjectEntityFrameworkCoreModule.cs
Configure<AbpDbContextOptions>(options => { /* The main point to change your DBMS. * See also PlmAPIMigrationsDbContextFactory for EF Core tooling. */ options.UseSqlServer(); //TODO: Debug 用完需注释,避免影响整体性能 options.Configure(configureOptions => { configureOptions.UseSqlServer(); configureOptions.DbContextOptions.EnableSensitiveDataLogging(); }); });
本文参照: