使用 ColumnAttribute 属性 (Attribute) 的 LINQ to SQL Expression 属性 (Property) 可表示其内容为计算结果的列。
有关代码示例,请参见Expression。
![]() |
---|
LINQ to SQL 不支持作为主键的计算所得列。 |
表示计算所得的列
将 Expression 属性 (Property) 添加到 ColumnAttribute 属性 (Attribute)。
将公式的字符串表示形式赋给 Expression 属性。
使用 ColumnAttribute 属性 (Attribute) 的 LINQ to SQL Expression 属性 (Property) 可表示其内容为计算结果的列。
有关代码示例,请参见Expression。
![]() |
---|
LINQ to SQL 不支持作为主键的计算所得列。 |
将 Expression 属性 (Property) 添加到 ColumnAttribute 属性 (Attribute)。
将公式的字符串表示形式赋给 Expression 属性。