.
This commit is contained in:
26
Web/public/doc-code/application/entity.cs
Normal file
26
Web/public/doc-code/application/entity.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
// Table特性设定表在数据库中的表名
|
||||
[Table("bs_table_name")]
|
||||
[Comment("表名")]
|
||||
// 这里继承Core.DEntityBase,会自动添加Id及一些常用字段
|
||||
public class BsTableName : Core.DEntityBase
|
||||
{
|
||||
// Comment特性用于生成字段说明
|
||||
[Comment("字符字段")]
|
||||
// MaxLength特性用于限定字段值长度,可以不设置
|
||||
[MaxLength(50)]
|
||||
// Required特性设置字段是否不为空
|
||||
[Required]
|
||||
public string StringField { get; set; }
|
||||
|
||||
[Comment("整形字段")]
|
||||
[MaxLength(3)]
|
||||
[Required]
|
||||
public int IntField { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user