Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. EF Code First - Map Dictionary or custom type as an nvarchar
  2. [NotMapped]
  3.     public Dictionary<string,string> MyDictionary
  4.     {
  5.      get; set;
  6.     }
  7.  
  8.     public string DictionaryAsXml
  9.     {
  10.         get
  11.         {
  12.              return ToXml(MyDictionary);
  13.         }
  14.         set
  15.         {
  16.            MyDictionary = FromXml(value);
  17.         }
  18.     }