C# 什么';这是将特定参数传递给方法的最佳方式

C# 什么';这是将特定参数传递给方法的最佳方式,c#,dictionary,C#,Dictionary,我正在编写一个C#components,它从输入参数收集信息,并在字典中返回收集的信息,如下所示:dictionary。当前方法签名如下所示: public Dictionary<string, object> GenerateAliquotLabel(EAliquoteLabelOptions fieldsToAdd, AliquoteLabelGeneratorParameters parameters) public Dictionary generatealikotlabe

我正在编写一个C#components,它从输入参数收集信息,并在字典中返回收集的信息,如下所示:dictionary。当前方法签名如下所示:

public Dictionary<string, object> GenerateAliquotLabel(EAliquoteLabelOptions fieldsToAdd, AliquoteLabelGeneratorParameters parameters)
public Dictionary generatealikotlabel(ealikotelabeloptions字段添加,等分elabelgeneratorparameters参数)
parameters参数包含从中返回信息的所有源。我返回的字典中的键当前是在内部生成的


问题是,现在我想在字典中指定作为参数返回的键,但我不知道任何优雅的方法。

如果我理解正确,您的选项是params

public Dictionary<string, object> GenerateAliquotLabel(params string[] parameters);
var output = Generator.GenerateAliquotLabel("BlueLabel", "RedLabel", "SmallLabel");