Developer Tools

Convert SQL table definitions to C# classes

Generate strongly typed C# model classes from SQL table definitions and quickly copy or download the generated code.

转换器工作区

在左侧粘贴您的 SQL,在右侧获取干净的 C# 实体代码。

T-SQL 输入

CREATE TABLE

C# 实体输出

Entity Framework
支持的 SQL 类型 int, bigint, smallint, tinyint, bit, decimal, numeric, money, float, real, date, datetime, datetime2, time, uniqueidentifier, nvarchar, varchar, nchar, char, text, ntext 等等。
主键检测 支持内联 (Inline) 主键和常见的表级主键定义。
最佳结果 粘贴完整的 CREATE TABLE 语句,包括 Schema、可空性和长度。

SQL Table to C# Class Converter

此页面专为希望获得具有快速转换、可读输出和实用的面向 Entity Framework 选项的在线 sql table to csharp class 工作流的开发者而构建。

  • Convert SQL table columns into strongly typed C# properties
  • Use PascalCase property naming for cleaner model classes
  • Support common SQL Server data types and column lengths
  • Generate copy-ready C# output for application models
常见问题

常见问题解答

What is a SQL table to C# class converter?

It is a tool that reads a SQL table definition and generates a C# class with properties that match the table columns.

Can it convert SQL column names to PascalCase?

Yes. The converter can transform SQL-style names into PascalCase C# property names.

Can I use the generated class in .NET projects?

Yes. The generated class can be used as a starting point for .NET models, DTOs or Entity Framework entities.