Hi,

This is more of a .NET question rather than specifically C#, anyway..

I have an XML settings file that stores mappings between fields in two different databases.

<Mappings>
<Mapping name="userName">givenName</Mapping>
<Mapping name="telephone">telephoneNumber</Mapping>
etc...
</Mappings>


I have used XSD.exe to auto generate some classes from the files XSD schema and this results in an array that contains the Mapping objects.

I need to be able to itterate over the list of Mappings so an Array works fine for this. But I also need to access the Mappings via their name so it would be great if these were stored in some sort of dictionary and keyed by the name, eg..

Settings.Mappings["userName"] = "a new value";


Is there any way I can change my schema data structure to provide dictionary type access to the mappings, or can I provide any customized settings to XSD.exe to tell it not to use an array?


Many Thanks,
Martyn.