EPR类企业管理系统

在我们现有系统基础上或全新开发,提供定制服务
为您的企业高效快速实施ERP,WMS,MES,CRM管理系统
全面管控物料仓库、销售业务、采购业务、仓库业务
生产过程、质量检验、组织架构、业务报表


定制
QQ:460-3528

开发
QQ群:3360-90194

源码
微信:136-3650-3721

实体框架中的字符串属性

下面的示例说明如何在Entity Framework Code-First类中实现字符串属性

// By default, the string property size is 100.
public string DefaultSizeStringProperty { get; set; }
// The string property size is limited to 15.
[FieldSize(15)]
string ShortSizeStringProperty { get; set; }
// The string property size is unlimited. It is displayed via a memo editor.
// By default, this property is not displayed in List View. You can make its column visible via the VisibleInListView attribute.
[FieldSize(FieldSizeAttribute.Unlimited), VisibleInListView(true)]
public string UnlimitedSizeStringProperty { get; set; }
// The property has a list of predefined values.
[ModelDefault("PredefinedValues",
    "Predefined Value 1;Predefined Value 2;Predefined Value 3;Predefined Value 4;Predefined Value 5")]
public string StringWithPredefinedValuesProperty { get; set; }
// This property is displayed in the Rich Text Editor.
[FieldSize(FieldSizeAttribute.Unlimited)]
[EditorAlias(EditorAliases.RichTextPropertyEditor)] 
public string RichTextProperty { get; set; }

转载保留此链接,注明出处