Render C# class as javascript
<p>I'm looking for a way to render a C# class object to javascript. For instance this class definition:</p>

<pre><code>public class Foo
{ 
   public string Bar1 { get; set; }
   public string Bar2 { get; set; }
}
</code></pre>

<p>should render (an object of class Foo with values filled) as:</p>

<pre><code>foo: 
{
    bar1: 'bar1value',
    bar2: 'bar2value'
}
</code></pre>

<p>I know my way around reflection, but before reinventing the wheel all over again I was wondering if there are any libraries already doing these kind of things.</p>
