The below one is the sample component on SellableItem entity. I want to store the list of items in "Scaling Componet" section.
public class ScalingComponents : Component { public decimal Rate { get; set; } = 0.00M; public decimal Qty { get; set; } = 0.00M; public string RecordNumber { get; set; } = string.Empty; public string RecordSeq { get; set; } = string.Empty; }
var sampleProduct= new SellableItem { Id = productEntityId, ProductId = product.ProductId, Name = product.ProductId, DisplayName = product.DisplayName, Components = new List {
new ScalingComponents {
ChildComponents = new List<Component>
{
new ScalingComponents
{
Id = random.Next().ToString(),
Name = "scale1" ,
RecordNumber="1234",
RecordSeq ="1111",
Qty=1.20m,
Rate=2m
},
new ScalingComponents
{
Id = random.Next().ToString(),
Name = "scale2" ,
RecordNumber="5678",
RecordSeq ="2222",
Qty=4.20m,
Rate=4m
},
},
Name ="test"
}
}
};
This code is not inserting 2 rows in "Scaling" section in Sellable item view. Am i missing anything here?