Need some help with creating a custom list. After adding list membership to a commerce entity (customer) and calling IPersistEntityPipeline, the membership is saved on the customer itself, but the list itself is not created
my code:
var listComponent = customer.GetComponent<ListMembershipsComponent>();
listComponent.Memberships.Add("MyCustomList");
await _commander.Pipeline<IPersistEntityPipeline>().Run(new PersistEntityArgument(customer), context);
the customer entity membership component is showing the MyCustomList entry:
"$type": "Sitecore.Commerce.Plugin.ManagedLists.ListMembershipsComponent, Sitecore.Commerce.Plugin.ManagedLists",
"Memberships": {
"$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
"$values": [
"Customers",
"RecentCustomers",
"MyCustomList"
]
}
But MyCustomList does not appear under CustomerLists or CommerceLists in the database.
I have set the PlugIn.SQL.Sharding.PolicySet-1.0.0.json:
"$type": "Sitecore.Commerce.Plugin.SQL.ListShardingPolicy, Sitecore.Commerce.Plugin.SQL",
"Expressions": {
"$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
"$values": [
"^List-Customer.*?$",
"^Entity-Customer.*?$",
"^List-RecentCustomers.*?$",
"^List-MyCustomList.*?$",
"^Customer-.*?$"
]
},
"TableName": "CustomersLists"