I’m unsure which collection type to use in my Request DTO. Dictionaries are the easiest to work in this case as the Key ensures the uniqueness at schema level. However long term I’m not sure if I’ll run into trouble.
To experienced services designers, which would be the preferred approach out of these choices?
A
public class UpdateAdditionalInformation
{
public string Code { get; set; }
public Dictionary<int, string> AdditionalInformation { get; set; } // dictionary of AdditionalFieldId and Value
}
B
public class UpdateAdditionalInformation
{
public string Code { get; set; }
public List<AdditionalInformationItem> AdditionalInformation { get; set; }
}
public class AdditionalInformationItem
{
public int AdditionalFieldId { get; set; } // id of field metadata
public string Value { get; set; }
}
C
public class UpdateAdditionalInformation
{
public string Code { get; set; }
public Dictionary<int, AdditionalInformationItem> AdditionalInformation { get; set; }
}
public class AdditionalInformationItem
{
public string Value { get; set; }
// Possibly expanded in the future
}