title: EF Code First - Map Dictionary or custom type as an nvarchar
body: <p>I want to use EF Code first for a database that I'm currently accessing using plain old ADO.NET with stored procedures.</p>
  
  <p>In my database I have some <code>nvarchar(MAX)</code> columns that should be mapped to and from a <code>Dictionary&lt;string, string&gt;</code>. </p>
  
  <p>When saved to database, it is an XML formatted string. I use this technique to allow internationalization of e.g. a name of a product in an online store. I don't know how many languages any given user want to translate to so I can't have a <code>Name</code> column for each language.</p>
  
  <p>I also wanted to avoid storing the values in a seperate table, so I ended up with the Dictionary - XML approach.</p>
  
  <p>The way I do it now, is to just treat any of these columns as a string whenever I interact with the database. I have a custom mapper function that can turn the XML into a Dictionary, and back to XML.</p>
  
  <p>But I can't seem to find a way to do this with EF Code first? Any ideas?</p>