FreeSql
FreeSql copied to clipboard
建议增加CodeFirst模式下Postgresql计算列功能
Feature 特性
CodeFirst模式下Postgresql计算列功能
简要描述原因
postgresql计算列文档地址 http://www.postgres.cn/docs/12/ddl-generated-columns.html
使用场景
jsonb字段需要将属性建立计算列,以使用btree索引。
class X
{
[Column(CanInsert = false, CanUpdate = false, DbType = "numeric GENERATED ALWAYS AS (height_cm / 2.54) STORED")]
public decimal height_in { get; set; }
}