Example #1
0
 /// <summary>
 /// 设置字段是否不限制长度
 /// </summary>
 /// <param name="propertyBuilder"></param>
 /// <param name="configurationSource"></param>
 /// <param name="hasMaxLength"></param>
 /// <returns></returns>
 public static InternalPropertyBuilder HasMaxLength(this InternalPropertyBuilder propertyBuilder, ConfigurationSource configurationSource, bool?hasMaxLength)
 {
     if (hasMaxLength.HasValue && hasMaxLength.Value == true)
     {
         Console.WriteLine($"HasMaxLength(true) remove MaxLength Annotation.entity:{propertyBuilder.Metadata.DeclaringType.Name};property:{propertyBuilder.Metadata.Name};{configurationSource}");
         propertyBuilder.HasAnnotation(CoreAnnotationNames.MaxLengthAnnotation, null, configurationSource);
     }
     return(propertyBuilder);
 }