My entity has a property which is allowed to be null. BUT, if it isn't null, then it must be unique. In other words, the column is unique but allows multiple nulls.
I've tried:
config.Property(p => p.ProductId).IsRequired(false);
I remember struggling to get this to work in pre-Core EF.
Is this possible? How do I configure the entity?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…