On this page, there is a setting named "CollectionNavigatorType" https://www.llblgen.com/Documentation/5.3/Entity%20Framework/VCore2/AvailableOutputSettings.htm
Where in the designer can I change that value for a specific navigator? I want the type of just one of these to be different.
My code-gen reads as follows, so this is where I need to detect the value I set in the designer.
var relationshipInitializersBuilder = new StringBuilder();
foreach(var relationshipInfo in allRelationshipInfosToTraverse)
{
if(relationshipInfo.NavigatorIsHidden)
{
continue;
}
switch(relationshipInfo.RelationshipType)
{
case EntityRelationshipType.OneToMany:
var collectionType = "List";
var settingValue = relationshipInfo.NavigatorInstance.OutputSettingValues.GetRealStringSettingValue("CollectionNavigatorType", currentProject);
switch(settingValue)
{
case "List<T>":
collectionType = "List";
break;
case "ICollection<T>":
collectionType = "HashSet";
break;
case "IEnumerable<T>":
// no instantiation, continue.
continue;
}
relationshipInitializersBuilder.AppendLine(
" this." +
relationshipInfo.Navigator +
" = new " + collectionType + "<" + relationshipInfo.RelatedEntity.Name + ">();"
);
break;
}
}