title: Web api saving json to database and get as json
body: <p>I am using web api and I need to saving json objects to my database. I will get the screen size, color, ... and save to database. </p>
  
  <pre><code>{ "height": 1536, "width": 2048, "color": "#114521" }
  </code></pre>
  
  <p>But I do not want to create C# class for this data. I want to create a class named settings:</p>
  
  <pre><code>public class Settings{ 
     public string Username {get;set;}
     public string Data {get;set;}  // This will be json settings data
  }
  </code></pre>
  
  <p>But I will get back this as json object.</p>
  
  <p>I am creating a new settings C# instance:</p>
  
  <pre><code>public Settings Get(){
     var settings = new Settings{
      Username="myname",
      Data="{ \"height\": 1536, \"width\": 2048, \"color\": \"#114521\" }"
     };
     return settings;
   }
  </code></pre>
  
  <p>But <code>Data</code> is going to client as text,  not json object.
  (I will save <code>Data</code> to database as raw json.)</p>