title: Deserialize Abstract Class
body: <p>I have an abstract class 'Server' which I create in my JavaScript in my UI and then I want to have a method on my Web Service which does the following:</p>
  
  <pre><code>public List&lt;Database&gt; GetDatabases(Server server)
  {
      Type type = server.GetType();
      Server x = null;
  
      if (typeof (SqlServer2005Server).Equals(type))
      {
          x = new SqlServer2005Server();
      }
  
      // Return the Databases from the server
      return x.GetDatabases();
  }
  </code></pre>
  
  <p>The issue I am having is that Server can not be deserialized as it is abstract, Do I need to have a method for each Server I have which inherits from the concrete type i.e</p>
  
  <pre><code>public List&lt;Database&gt; GetDatabases(SqlServer2005Server server)
  {
      // Return the Databases from the server
      return SqlServer2005Serverx.GetDatabases();
  }
  
  public List&lt;Database&gt; GetDatabases(OracleServer server)
  {
      // Return the Databases from the server
      return SqlServer2005Serverx.GetDatabases();
  }
  </code></pre>
  
  <p>I would really appreciate your help as i am not sure what is the best solution</p>
  
  <p>The exact error I receive is:</p>
  
  <blockquote>
    <p>Instances of abstract classes cannot be created.</p>
  </blockquote>