Design of API to accept multiple choices in C#?
<p>I have an interface/abstract class where the implementation can support an arbitrary sized dictionary of <code>Name</code>, <code>identifier</code>.  Each implementation will have a different format for <code>identifier</code> which is implementation specific.</p>

<p>The caller needs to retrieve the list of <code>Name</code>s from the provider and use those to ask the user which he cares about.  The user can select one or more.</p>

<p>I considered the following design where the caller gets an array of names and sets the user's choice by passing in an array of ints, identifying the array indicies of the names the user chose.</p>

<pre><code>public abstract String[] GetNames();
public abstract void SetNamesToUse(int[] names);
</code></pre>

<p>Not happy with this, I also considered a model where a list of objects would be passed around:</p>

<pre><code>public class NameObject {
    public bool SelectedByUser;
    public String Name;
    private String ProviderSpecificData;
}

...

public abstract List&lt;NameObject&gt; GetNames();
public abstract void SetNamesToUse(List&lt;NameObject&gt; names);
</code></pre>

<p>This seems cleaner and easier on the caller. </p>

<p>What other choices do I have? How have you solved similar?</p>
