Re: A dictionary with many keys for the same value
- From: Dustin Campbell <dustinc@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 12 Oct 2006 19:24:53 +0000 (UTC)
Your stated requirement appears contradictory since your example code
does in fact add two items. Do you mean that you want to "rewrite"
the key (from 0 to 11 in this case)? In that case the technique would
be to remove the item with key == 0, then add it back with key == 11.
This does of course add the item twice, however the resulting
collection.Count would be 1 as desired.
I think he was pretty clear. The example code adds the same item twice but with different keys. He wants the collection to contain two keys pointing to the same item so that the isn't a one-to-one relationship between a key and the item.
Best Regards,
Dustin Campbell
Developer Express Inc.
.
- Follow-Ups:
- Re: A dictionary with many keys for the same value
- From: Rick Lones
- Re: A dictionary with many keys for the same value
- From: Martin
- Re: A dictionary with many keys for the same value
- References:
- Re: A dictionary with many keys for the same value
- From: Rick Lones
- Re: A dictionary with many keys for the same value
- Prev by Date: Re: Passing a method as a parameter
- Next by Date: Re: Creating a Blank C# project from command line
- Previous by thread: Re: A dictionary with many keys for the same value
- Next by thread: Re: A dictionary with many keys for the same value
- Index(es):
Relevant Pages
|