c# - NopCommerce add new table - invalid column name 'Product_Id1' -
i'm figting add together new table in mycommerce
engine;
relation
[product] 1..* [awards]
code files:
public partial class awards : baseentity, ilocalizedentity { public virtual product product { get; set; } public string awarddescription { get; set; } public guid awardguid { get; set; } public int product_id { get; set; } } public partial class awardsmap : entitytypeconfiguration<awards> { public awardsmap() { this.totable("awards"); this.haskey(p => p.id); this.property(p => p.awardguid).isoptional(); this.property(p => p.awarddescription).isoptional(); this.hasrequired(p => p.product) .withmany(pt => pt.productawards) .map(m => m.totable("awards")); } } public partial interface iawardsservice { void deleteawards(awards awards); ilist<awards> getallawardss(); awards getawardsbyid(int awardsid); void insertawards(awards awards); void updateawards(awards awards); }
and awardsservice.cs
class implements iawardsservice
interface (in same way producttagservice.cs
)
product.cs
code snippet:
private icollection<awards> _awards; public virtual icollection<awards> productawards { { homecoming _awards ?? (_awards = new list<awards>()); } protected set { _awards = value; } }
but every time load product fromdatabase , seek load productawards proparte error
invalid column name 'product_id1'. invalid column name 'product_id1'.
what's going on ?
editi saw customer, customeraddress, address
tables , i've modified mine classes looking same ones , it's working.
please check mapped table having same column name defined in class.
here looks conflict throwing error invalid column name 'product_id1
' , name of property in class product_id
.
c# asp.net-mvc nopcommerce
No comments:
Post a Comment