title: C# .NET SQL building classes from code stored in database and executing during runtime
body: <p>Is it possible to load base class and a child classes from database during runtime of an application and compile them and execute the code? With inheritance? If so how does one do it.</p>
  
  <p>I've created a created a basic ERD of the database of my needs and attached to the post.</p>
  
  <p>A basic structure of the database table will be as follows: </p>
  
  <p>The table structure will look like:</p>
  
  <pre><code>CREATE TABLE Class
  (
      ClassID INT PRIMARY KEY NOT NULL,
      BaseClassID INT NULL,
      ClassName VARCHAR(MAX),
      Code VARCHAR(MAX),
      FOREIGN KEY (BaseClassID) REFERENCES Class(ClassID)
  )
  
  CREATE TABLE Item
  (
     ItemID int primary key NOT NULL,
     ClassID int NOT NULL,
     FOREIGN KEY (ClassID) REFERENCES Class(ClassID)
  )
  </code></pre>
  
  <p>Any advice would be greatly appreciated.</p>