Ejemplo n.º 1
0
 /// <summary>
 /// 固定长度
 /// </summary>
 /// <typeparam name="TProperty">属性类型</typeparam>
 /// <param name="propertyBuilder">扩展的属性构造器长度</param>
 /// <param name="length"></param>
 /// <returns></returns>
 public static PropertyBuilder <TProperty> HasFixedLength <TProperty>(this PropertyBuilder <TProperty> propertyBuilder, int length)
 {
     return(propertyBuilder.HasMaxLength(length).IsFixedLength());
 }
Ejemplo n.º 2
0
 public static PropertyBuilder <string> IsRequiredAndMaxLength(this PropertyBuilder <string> builder, EntityProperty entConst)
 {
     builder.IsRequired(entConst.IsRequired);
     builder.HasMaxLength(entConst.MaxLength);
     return(builder);
 }