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

Entity Framework 6 Custom query to IDictionary

I want to run custom query on a dynamic table or view which is not Modeled I always need 1 record, but the field name are not known some time it could be view_1, view_2, table_1 etc. I need the result in key pair values…
user10182659
1
vote
1 answer

Binding, Updating Listbox with List, Dictionary or DataTable

I have been looking into this for a while and there are lots of questions on this topic but I have not been able to find a clear answer. I have a Listbox (listBox1) and IDictionary (clients) object in Windows Forms application. public static…
user2288650
  • 412
  • 1
  • 6
  • 23
1
vote
4 answers

C# - Dictionary to List

I want to map my Dictionary to a List where Customer has two properties Id and Name. Now I want to map my integer Key of the dictionary to the List[i].Key property and Value of the dictionary to…
Huzefa Kagdi
  • 159
  • 1
  • 4
  • 11
1
vote
1 answer

Remove Escape Character '\' from dynamic JSON using ExpandoObject and IDictionary

I am creating a Dynamic JSON using ExpandoObject and IDictionary. My Sample Code is as below : DataTable dt_MappedColumns = new DataTable(); dt_MappedColumns.Columns.Add("Sr.No"); dt_MappedColumns.Columns.Add("TColumnName"); …
Mufaddal
  • 558
  • 5
  • 24
1
vote
0 answers

Fluent NHibernate HasManyToMany() IDictionary<> Composite ID problem

I'm using Fluent NHibernate 1.1.1.694 which uses a slightly different syntax than FNH1.0, especially when it comes to dictionary mapping. In my model, I have Employees, Addresses and AddressTypes (postal, physical, etc). public class Employee { …
Francois Botha
  • 4,520
  • 1
  • 34
  • 46
1
vote
2 answers

Dictionary object syntax?

I'm having trouble figuring out the syntax for a JScript .NET dictionary object. I have tried private var myDictionary: Dictionary; but the compiler complains that it's missing a semicolon and that the Dictionary object is not…
posfan12
  • 2,541
  • 8
  • 35
  • 57
1
vote
1 answer

How to write a unit test for Updating an IDictionary

I am trying to write a unit test for a method to add or update an IDictionary Here is the my add or update method: public static class ExtensionMethods { public static void AddOrUpdate(IDictionary Dictionary,…
Luke
  • 43
  • 5
1
vote
0 answers

Pass custom fields to Active Campaign Api

Hi I am using following code to add contact to Active Campaign api (http://www.activecampaign.com/). The contact gets added however the custom field "%ISTRIAL%" is always blank. Can someone please let me know what is wrong with follwoing: var…
Max
  • 470
  • 2
  • 9
  • 22
1
vote
1 answer

Enumerate keys and values of IDictionary when I don't know type of values

I have a reference to an object. I know it conforms to IDictionary for some type T. (It may not conform to plain IDictionary, or to IReadyOnlyDictionary). All I know about T is that it descends from object. How can I get its keys, and…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
1
vote
1 answer

Unable to initialize a dictionary with an array variable

How can I convert {{"variable", "default value"},{"integer","123"}} as in Public PredefinedVariables As New ReadOnlyDictionary(Of String, String) ({{"variable", "default value"},{"integer","123"}}) to IDictionary(Of String, String)? (Maybe you…
Happypig375
  • 1,022
  • 1
  • 12
  • 32
1
vote
1 answer

c# asp mvc how to get derived class object values

Can anyone help how to get derived class objects values? When I try to cast from derived class (Currency) to parent class (Entity) I get null's. Real values from DB: http://prntscr.com/ahmy9h Null's after casting to Entity:…
Alexandr
  • 33
  • 6
1
vote
1 answer

Dynamic KeyValuePair in foreach's OrderBy

I'm trying to replicate SQL's ORDER BY. I'm fetching data from several tables and adding it to a dictionary. Everything is working fine, but I would like to be able to order the data dynamically. Meaning the user might want to order it by username,…
Cornwell
  • 3,304
  • 7
  • 51
  • 84
1
vote
1 answer

Calling the property names of a dynamic property "ints": can't call property

I am assigning property names of a dynamic object as ints in string form. The int value represents an int ID in a database I am using. However I am stuck on how to retrieve the value assigned to the property as shown below: dynamic test = new…
Nic
  • 61
  • 8
1
vote
3 answers

c# JSON object dynamic variables

I have a requirement to generate the following JSON using c# objects: Right now Im using HttpResponseMessage (Web API) So I dont need any JSON.NET to do any extra conversion from my object. returnVal = Request.CreateResponse(HttpStatusCode.OK, new…
VAAA
  • 14,531
  • 28
  • 130
  • 253
1
vote
1 answer

How do I enumerate a static dictionary contained in a static class from asp.net ( aspx) page

I don't understand how to loop over a static dictionary contained in a static class from my aspx page. I have this for the static class public static class ErrorCode { public static IDictionary ErrorCodeDic; static…
Breadtruck
  • 1,943
  • 5
  • 25
  • 39