I have an issue upgrading my mappings from version 3.9 to 4.3.
I am trying to populate both Subgroup.Items and Item.Subgroup when loading from the database using a service class.
This is the code in 3.9
- MenuItem
public string Name { get; set; }
public int DisplayOrder { get; set; }
public virtual TND_MenuSubgroup Subgroup { get; set; }
public int TND_MenuSubgroupId { get; set; }
- MenuSubgroup
private ICollection<TND_MenuItem> _items;
public string Name { get; set; }
public int DisplayOrder { get; set; }
public virtual ICollection<TND_MenuItem> Items
{
get { return _items ?? (_items = new List<TND_MenuItem>()); }
protected set { _items = value; }
}
- Mapping
this.HasRequired(pp => pp.Subgroup)
.WithMany(p => p.Items)
.HasForeignKey(pp => pp.TND_MenuSubgroupId);
I have created the domain objects in nopcommerce 4.3, but i have no idea how to upgrade the mapping, since i can't use the same syntax. It seems like the mapping is replaced by a Builder, but i can't really find any information on how to use them.
All help is appreciated :)