Closed Gekctek closed 1 year ago
Just to clarify, adding here the current implementation and the proposal:
// Candid:
type ItemService = record {
dictionary : Items_Dictionary;
};
type Items_Dictionary = vec record {
text; Item
};
type Item = record {
name : text;
};
// Current C# generated code:
public class ItemService
{
public List<Items_DictionaryItem> dictionary { get; set; }
}
public class Items_DictionaryItem
{
[CandidTag(0U)] public string F0 { get; set; }
[CandidTag(1U)] public Item F1 { get; set; }
}
public class Item
{
public string name { get; set; }
}
// Proposal:
public class ItemService
{
[SerializeAsList] public Dictionary<string, Item> dictionary { get; set; }
}
public class Item
{
public string name { get; set; }
}
Done. Dictionaries are treated as vec rec {t1;t2;}
vs