Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
Hey card game player if you are interested in playing the single player card game then here you will play spider solitaire games without any download and subscription.
Himanshu Mishra, May 28, 2018
Reply 2
You can also use Tuple, to achieve this...

HTH!


namespace MultiKeyDictionary.Console {
    using System.Collections.Generic;
    using System;

    internal class Program {
        private static void Main(string[] args) {
            var dictionary = new Dictionary<Tuple<string,string>, string>();

            var key = new Tuple<string, string>("multiple", "keys");
            var value = "Open Sesame!";

            dictionary.Add(key, value);
            Console.WriteLine(dictionary[key]);
        }
    }

    public struct Tuple <T1, T2> {
        public readonly T1 Item1;
        public readonly T2 Item2;

        public Tuple(T1 item1, T2 item2) {
            Item1 = item1;
            Item2 = item2;
        }
    }
}

 
Robert Blixt, Dec 20, 2010
Reply 3
Zhang:

What if you create a unique hash for the 3 concatenated keys?
Then use this as the unique key in a regular Dictionary.

So, something like:

Dictionary<string, object> dictionary = new Dictionary<string, object>();

and then:

dictionary.Add( Hash(key1, key2, key3), myObject);

where Hash is a simple method that concatenates the 3 keys (the arguments) and returns a hash.




Deshaun Hyram, Dec 16, 2010
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas