Extending entities in plugin

7 месяцев назад
I use nopcommerce 4.50.4
I created a new domain entity called market that extends the vendor class
public class marketBuilder : NopEntityBuilder<market>
{
    public override void MapEntity(CreateTableExpressionBuilder table)
    {
        table.WithColumn("Id").AsInt32().ForeignKey<Vendor>().PrimaryKey()
            .WithColumn("shelves").AsInt32().Nullable()
    }
}
the builder does not work for some reason he creates a clinic table with all vendor properties
I want this table to be an extension of the vendor table
any help to let migration know that this entity is an extension to the old one to add one column not whole table with the combined properties
7 месяцев назад
Seems like you are experiencing the same behaviour that I came across after switching to 4.50.4: https://www.nopcommerce.com/en/boards/topic/97964/how-to-do-eager-loading-in-nopcommerce-450

I ended up removing inheritance and replaced it with VendorID as a primary key inside of my other object. In your case Market :  BaseEntity { ... VendorID ...}

Not exactly what you may be looking for, but it did the job.