c# dictionary one key many values
I want to create a data store to allow me to store some data. The first idea was to create a dictionary where you have 1 key with many values, so a bit like a one to many relationship. I think the dictionary only has 1 key value. How else could I store this information? As of .net3.5+ instead of using a Dictionary<IKey, List<IValue>> you can use a Lookup from the Linq namespace: // lookup Order by payment status (1:m) // would need something like Dictionary<Boolean, IEnumerable<Order>> orderIdByIsPayed ILookup<Boolean, Order> byPayment = orderList.ToLookup(o => o.IsPayed); IEnumerable<Order>