ServiceStack OrmLite:Table 创建时的字段类型 table 表单 c#
ServiceStack OrmLite: Table field type when create table form c#
我需要在输入 "Text" 时创建 table 字段。
public class PropsTable {
public string PropKey { get; set; }
public string PropValue { get; set; }
}
....
db.CreateTableIfNotExists<PropsTable>();
当我执行此类型时:varchar(255)
然后您可以决定如何执行此操作?
谢谢。
告诉 OrmLite 创建带有大文本字段的 table 的通用(即跨 RDBMS)方法是使用 [StringLength(StringLengthAttribute.MaxText)]
,例如:
public class PropsTable
{
public string PropKey { get; set; }
[StringLength(StringLengthAttribute.MaxText)]
public string PropValue { get; set; }
}
对于特定于 RDBMS 的列定义,您可以使用 [CustomField]
,例如:
[CustomField("text")]
public string PropValue { get; set; }
我需要在输入 "Text" 时创建 table 字段。
public class PropsTable {
public string PropKey { get; set; }
public string PropValue { get; set; }
}
....
db.CreateTableIfNotExists<PropsTable>();
当我执行此类型时:varchar(255)
然后您可以决定如何执行此操作?
谢谢。
告诉 OrmLite 创建带有大文本字段的 table 的通用(即跨 RDBMS)方法是使用 [StringLength(StringLengthAttribute.MaxText)]
,例如:
public class PropsTable
{
public string PropKey { get; set; }
[StringLength(StringLengthAttribute.MaxText)]
public string PropValue { get; set; }
}
对于特定于 RDBMS 的列定义,您可以使用 [CustomField]
,例如:
[CustomField("text")]
public string PropValue { get; set; }