Questions tagged [idictionary]

System.Collections.IDictionary and System.Collections.Generic.IDictionary interfaces in the BCL (Base Class Library) of the .NET framework represent a collection of key-value pairs.

System.Collections.IDictionary and System.Collections.Generic.IDictionary<TKey, TValue>interfaces in the BCL (Base Class Library) of the .NET framework represent a collection of key-value pairs.

MSDN links:

148 questions
1
vote
1 answer

C# Convert IDictionary to two ILists

I need to create an IList with the keys and another IList with the values, taken from an IDictionary. How do I do it? I had to avoid generics (List<> and Dictionary<>) because the types inside them are user defined types not known at compile time. I…
Kaikus
  • 1,001
  • 4
  • 14
  • 26
1
vote
0 answers

casting a json referenced by a dynamic type parameter to a Idictionary

I've come across the following code that doesn't work public void Execute(dynamic options){ var dictionary = options as IDictionary();//i saw the dictionary is always null but the developer is says it suppose to work! } where the…
user2003511
  • 77
  • 1
  • 9
1
vote
6 answers

Cast to IDictionary

The function below returns a type of Dynamic, what is the most efficient way to cast it to IDictionary public dynamic GetEntities(string entityName, string entityField)
user1842828
  • 311
  • 3
  • 9
  • 17
1
vote
2 answers

IDictionary to string

I have created an IDictionary extension to write IDictionary Exception.Data values to a string. The extension code: public static class DictionaryExtension { public static string ToString(this IDictionary source,…
Tomas
  • 17,551
  • 43
  • 152
  • 257
1
vote
3 answers

IEnumerable> vs IDictionary

I've a question. I most recently changed one of my IDictionary to a IEnumerable. This was made because this collection of items shouldn't be modified. As i can see these are the same but IEnumerable dosn't implement the Add, remove…
Jonas W
  • 3,200
  • 1
  • 31
  • 44
1
vote
1 answer

NHibernate QueryOver the values of a dictionary(map)

For a project i'm working on, i need to query over the values of a mapped dictionary in Nhibernate. Something like SELECT * FROM EntityWithDictionary WHERE EntityWithDictionary in (select EntityFromDictionaryId FROM Dictionary where value =…
Rob Van Pamel
  • 734
  • 1
  • 8
  • 23
1
vote
11 answers

How can I store same key in IDictionary?

I'm using C# 4.0. I want to store (string,string) pair using IDictionary. like below: Dictionary _tempDicData = new Dictionary(); _tempDicData.Add("Hello", "xyz"); _tempDicData.Add("Hello", "aaa"); …
Dharmik Bhandari
  • 1,702
  • 5
  • 29
  • 60
1
vote
2 answers

How to do an MVC dropdownlist using IDictionary when it's not part of a table

I had some code which in the razor file within a table set a dropdownlist using: foreach (var item in group) { ... @Html.DropDownListFor(modelItem => item.OfficeUserId,…
AnonyMouse
  • 18,108
  • 26
  • 79
  • 131
0
votes
1 answer

XML and IDictionary in C#

My XML file is as follows,
xyz
Saturday, Oct 2, 8pm
abc
Saturday, Oct 2,…
Krishh
  • 4,111
  • 5
  • 42
  • 52
0
votes
1 answer

Using IDictionary with Json?

how to get the friends list (below) into and out from a iDictionary? Example {   "data": [     {       "name": "John Smith",       "id": "111"     },     {       "name": "Alice Smith",       "id": "222"     },     {       "name": "Mary Smith",…
001
  • 62,807
  • 94
  • 230
  • 350
0
votes
1 answer

NHibernate 2.0: Cfg.Configuration.SetProperties Issue with IDictionary

I have a problem with: NHibernate.Cfg.Configuration.SetProperties() Not accepting the IDictionary: NHibernateConfigHandler I get the messages: Error 30 The best overloaded method match for…
Robs
  • 8,219
  • 6
  • 41
  • 57
0
votes
1 answer

How come Dictionary has private interface methods?

While I was trying to implement the IDictionary interface on one of my classes, I chose to delegate all the interface methods of IDictionary to an instance of Dictionary that I had instantiated in my class.…
David von Tamar
  • 797
  • 3
  • 12
  • 29
0
votes
1 answer

Cannot implicitly convert ExpandoObject to IDictionary in c#

I'm working on a game in Unity using c#, and I have a class that converts my leaderboard spreadsheet to an ExpandoObject. Unity isn't allowing me to access its properties of it, so I'm trying to convert it to an IIDictionary, which I know works…
0
votes
2 answers

Dependency Injection - interfaces in a Dictionary c#

I want to inject a IDictionary of {key, interface} into a contructor, but I have no idea how to set it up in the program.cs I can initiate the Interfaces and I can could initiate an IDictionary but I have no idea how to combine them. Any suggestions…