예제 #1
0
 /// <summary>
 /// Sets the MySQL collation on the table associated with this entity. When you only specify the collation, MySQL implicitly sets
 /// the proper character set as well.
 /// </summary>
 /// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param>
 /// <param name="collation"> The name of the collation. </param>
 /// <param name="explicitlyDelegateToChildren">
 /// Properties/columns don't explicitly inherit the collation if set to <see langword="false"/>.
 /// They will explicitly inherit the collation if set to <see langword="null"/> or <see langword="true"/>.
 /// </param>
 /// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
 /// <returns> The same builder instance so that multiple calls can be chained. </returns>
 public static IConventionEntityTypeBuilder UseCollation(
     [NotNull] this IConventionEntityTypeBuilder entityTypeBuilder,
     [CanBeNull] string collation,
     bool explicitlyDelegateToChildren,
     bool fromDataAnnotation = false)
 => entityTypeBuilder.UseCollation(
     collation,
     explicitlyDelegateToChildren == false
             ? DelegationModes.ApplyToTables
             : DelegationModes.ApplyToAll,
     fromDataAnnotation);
 /// <inheritdoc />
 protected override void ProcessEntityTypeAdded(
     IConventionEntityTypeBuilder entityTypeBuilder,
     MySqlCollationAttribute attribute,
     IConventionContext <IConventionEntityTypeBuilder> context)
 => entityTypeBuilder.UseCollation(attribute.CollationName, attribute.DelegationModes);