title: Is it necessary to rewrite C# classes in JavaScript?
body: <p>I have a project that contains the logic for my application. </p>
  
  <p>I've exposed a rest service that takes JSON input, which is passed to the back-end and worked with. </p>
  
  <p>I'm now creating a web UI that allows users to create the necessary JSON.</p>
  
  <p>I have C# classes such as </p>
  
  <pre><code>public class Template 
  {
      public string TemplateName {get; set;}
      public List&lt;Column&gt; Columns {get; set;}
  }
  
  public class Column
  {
      public string ColumnName {get; set;}
  }
  </code></pre>
  
  <p>So I've been re-creating these classes in JavaScript.</p>
  
  <pre><code>function Template(templateName, columns) {
      this.TemplateName = name;
      this.Columns = columns;
  }
  
  
  function Column(columnName) {
      this.ColumnName = columnName;}
  </code></pre>
  
  <p>And my web page has some text fields that I input information, and from that information I'm creating the objects, and then I convert them to JSON. </p>
  
  <pre><code>    $scope.buttonClick = function () {
  
          var column = new Column('cName',$scope.selectedDataType,
              $scope.selectedDataType,
              $scope.selectedGenerator,
              'TEST');
  
          var columns = [];
          columns.push(column);
  
          var template = new Template($scope.TemplateName, $scope.RowCount, columns);
  
          var jsonbody = JSON.stringify(template);
  
          console.log(jsonbody);
      }
  </code></pre>
  
  <p>I'm obviously repeating work here, rewriting all the classes in JS and that FEELS wrong. Is there a better way? Should I be doing something different? </p>