I am new to nopCommerce development and trying to get my first plugin up and running. when I am doing my data mapping the ToTable is not recognize (see screenshots).
I am not sure which reference I am missing any help would be appreciated (name and path).
/// <summary> /// Configures the entity /// </summary> /// <param name="builder">The builder to be used to configure the entity</param> public override void Configure(EntityTypeBuilder<ProductTemplate> builder) { builder.ToTable(nameof(ProductTemplate)); builder.HasKey(template => template.Id);
Thanks for your reply, I tried that and this error came up
Severity Code Description Project File Line Suppression State Error CS1061 'EntityTypeBuilder<ProductSourceRecord>' does not contain a definition for 'ToTable' and no accessible extension method 'ToTable' accepting a first argument of type 'EntityTypeBuilder<ProductSourceRecord>' could be found (are you missing a using directive or an assembly reference?)
here is my full code
using Nop.Plugin.Widgets.ProductSourcing.Domain; using Nop.Data.Mapping; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using Nop.Data;
namespace Nop.Plugin.Widgets.ProductSourcing.Data { public partial class ProductSourceMap : NopEntityTypeConfiguration<ProductSourceRecord> { public override void Configure(EntityTypeBuilder<ProductSourceRecord> builder) { builder.ToTable("Product_Sourcing");
Clearly there is some definiton or something missing somewhere
When I added a new table I Searched for "ProductTemplate" and copied and pasted all existing relevant code and changed the code to make a new entity "ProductTypeExtension"
I did all this in the main program
Maybe you should do this first and get it working before moving the new code into a pluggin