I need a foreign key to be null, how can I do this with entity configure?
public void Configure(EntityTypeBuilder<CostCenter> entity)
{
entity.ToTable("CostCenter", ApplicationDataContext.DEFAULT_SCHEMA);
entity.Property(e => e.Id).ValueGeneratedNever();
entity.Property(e => e.Name)
.IsRequired()
.HasMaxLength(150)
.IsUnicode(false);
entity.Property(e => e.Uid).HasColumnName("UID");
entity.Property(e => e.UpdatedBy)
.IsRequired()
.HasMaxLength(250)
.IsUnicode(false);
entity.Property(e => e.UpdatedOn).HasColumnType("datetime");
}
Now I need to make this attribute that makes it null
entity.HasOne(e => e.Owner)
.WithMany()
.HasForeignKey(d => d.OwnerId)
.HasConstraintName("FK_CostCenter_Account_OwnerId");