オブジェクトへ:辞書<文字列、オブジェクト>最善の方法は、この辞書を変換する何
Dictionary<string, object> person = new Dictionary<string, object>();
person.Add("ID", 1);
person.Add("Name", "Alex");
オブジェクトへ:
public class Person
{
public int ID{get;set;}
public string Name{get;set;}
}
を?
このリンクをチェックアウト、それはあなたの質問にhttpを答えることがあります。//blog.andreloker .de/post/2008/05/03/Anonymous-type-to-dictionary-using DynamicMethod.aspx – MethodMan
データベースの選択クエリから返すオブジェクトが必要です。 –
辞書クラスには誤解があります。 1つの意味論的オブジェクトに対応する辞書の2つの異なる要素を作っているようです。あなたが必要とするのは、Personオブジェクトへのintマッピングを持つDictionaryオブジェクトのようです。 –