EFCore.BulkExtensions
EFCore.BulkExtensions copied to clipboard
TPH with re-used column names not supported
I have a TPH structure similar to the following where an inheriting class adds a property with the same name / column mapping as another inheriting class.
abstract class Mamal
{
}
class Person : Mamal
{
public string Name { get; set; }
internal new class Configuration : IEntityTypeConfiguration<Person>
{
public void Configure(EntityTypeBuilder<Person> builder)
{
builder.Property(x => x.Name).HasColumnName(nameof(Name));
}
}
}
class Pet : Mamal
{
public string Name { get; set; }
internal new class Configuration : IEntityTypeConfiguration<Pet>
{
public void Configure(EntityTypeBuilder<Pet> builder)
{
builder.Property(x => x.Name).HasColumnName(nameof(Name));
}
}
}
Using BulkInsert
this yields the following exception:
System.ArgumentException: An item with the same key has already been added. Key: Name
Not currently supported.
This could be a very nice feature.