So we have extended the Customer class in Nop.Core:
public partial class Customer
{
public string DiscountClass { get; set; }
public string RepCode { get; set; }
}
We have then extended the existing CustomerMap by creating another partial.
public partial class CustomerMap : NopEntityTypeConfiguration<Customer>
{
protected override void PostInitialize()
{
this.Map(m =>
{
m.Properties(p => new { p.Id, p.DiscountClass, p.RepCode});
m.ToTable("CustomerExtension");
});
}
But this seems not to properly work as we got an exception like so: "An item with the same key has already been added."
Are we doing something wrong in here? We should be able to extend a class in a different database table right ?
Both tables have the same primary key