Skip to content
On this page

EF Core Entities

csharp

Generate Entity Framework Core entity classes with data annotations from SQL schema

Usage

Add to your sqldoc.config.ts:

typescript
export default {
  dialect: 'postgres',
  schema: ['./schema.sql'],
  codegen: [
    {
      template: 'efcore',
      output: './generated/Models.cs',
    },
  ],
}

Then run:

bash
sqldoc codegen