update

28810
2019-09-11 20:54:07 +08:00
parent 2857dea00d
commit c41109e7fa

@@ -64,11 +64,13 @@ class Topic {
```csharp
class Topic {
[Column(IsNullable = false), MaxLength(128)]
[MaxLength(128)]
public string Title { get; set; }
}
```
MaxLengthAttribute 可以在任意地方定义,因为内部采用反射查找方法。该特性通常定义在 System.ComponentModel.DataAnnotations.MaxLengthAttribute但如果找不到该类可自行在项目中定义名称为 MaxLengthAttribute 的特性类,和它的属性 public int Length。
## 可空(Nullable)
```csharp