# GenerateModel

Source: https://help.codestencil.com/code-nanites/generatemodel

![](https://cdn.eniston.com/bases/5691f589-9697-4a3a-b3a1-f6588fa2e596/attachments/mceclip0_1704366016.png)

This will generate model classes for tables in your Schema. This is what setting up this Code Nanite looks like:

```
using System;
using System.Collections.Generic;

 
namespace MyProject.Models
{
  public partial class Course:  AuditableBaseEntity
   {
      public Course()
       {
           CourseAssignments = new HashSet<CourseAssignment>();
           Enrollments = new HashSet<Enrollment>();
       }
   
      public int CourseID { get; set; }
      public int Credits { get; set; }
      public string Title { get; set; }
      public int DepartmentID { get; set; }
      public virtual Department Department { get; set; }
      public virtual ICollection<CourseAssignment> CourseAssignments { get; set; }
      public virtual ICollection<Enrollment> Enrollments { get; set; }
   }
}
```

The highlighted code is what is generated and inserted by the  `CS_GENERATE_MODEL` code nanite. Also, it generates code for every table in your schema because in the label of the node ( See Code Tree), we used the `[%CS_TABLE_LIST%]` Code Nanite.
