【发布时间】:2021-10-15 11:53:15
【问题描述】:
我正在一个小型测试项目中进行一些发现,并尝试在配置定义类中设置断点。
public class TripExpenseComparisonEntityTypeConfiguration : IEntityTypeConfiguration<TripExpenseComparison>
{
public void Configure(EntityTypeBuilder<TripExpenseComparison> builder)
{
builder.HasKey(u => u.Id)
.HasName("PK_TravelExpense");
builder.OwnsOne(vo => vo.BudgetedTripExpense, exp =>
{
var x = from p in exp.GetType().GetProperties() where p.PropertyType == typeof(decimal) select p;
exp.Property(u => u.AllowNegatives)
.IsRequired();
exp.Ignore(u => u.TotalExpenses);
});
... rest removed
当我从包管理器控制台运行 Add-Migration 时,在 DataAccess 项目中,它运行整个迁移(正确)除了它没有命中在此行上设置的断点
>exp.Property(u => u.AllowNegatives)
.IsRequired();
断点在这种类型的类中不起作用吗?或者他们不会在添加迁移事件中受到影响?
【问题讨论】:
标签: c# entity-framework-core ef-fluent-api