Beispiel #1
0
 /// <summary>
 /// Sets the MySQL character set on the table associated with this entity. When you only specify the character set, MySQL implicitly
 /// uses its default collation.
 /// </summary>
 /// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param>
 /// <param name="charSet"> The name of the character set. </param>
 /// <param name="explicitlyDelegateToChildren">
 /// Properties/columns don't explicitly inherit the character set if set to <see langword="false"/>.
 /// They will explicitly inherit the character set if set to <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 HasCharSet(
     [NotNull] this IConventionEntityTypeBuilder entityTypeBuilder,
     [CanBeNull] string charSet,
     bool explicitlyDelegateToChildren,
     bool fromDataAnnotation = false)
 => entityTypeBuilder.HasCharSet(
     charSet,
     explicitlyDelegateToChildren == false
             ? DelegationModes.ApplyToTables
             : DelegationModes.ApplyToAll,
     fromDataAnnotation);
Beispiel #2
0
 /// <inheritdoc />
 protected override void ProcessEntityTypeAdded(
     IConventionEntityTypeBuilder entityTypeBuilder,
     MySqlCharSetAttribute attribute,
     IConventionContext <IConventionEntityTypeBuilder> context)
 => entityTypeBuilder.HasCharSet(attribute.CharSetName, attribute.DelegationModes);
Beispiel #3
0
 /// <summary>
 /// Sets the MySQL character set on the table associated with this entity. When you only specify the character set, MySQL implicitly
 /// uses its default collation.
 /// </summary>
 /// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param>
 /// <param name="charSet"> The character set. </param>
 /// <param name="explicitlyDelegateToChildren">
 /// Properties/columns don't explicitly inherit the character set if set to <see langword="false"/>.
 /// They will explicitly inherit the character set if set to <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 HasCharSet(
     [NotNull] this IConventionEntityTypeBuilder entityTypeBuilder,
     [CanBeNull] CharSet charSet,
     bool explicitlyDelegateToChildren,
     bool fromDataAnnotation = false)
 => entityTypeBuilder.HasCharSet(charSet?.Name, explicitlyDelegateToChildren, fromDataAnnotation);
Beispiel #4
0
 /// <summary>
 /// Sets the MySQL character set on the table associated with this entity. When you only specify the character set, MySQL implicitly
 /// uses its default collation.
 /// </summary>
 /// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param>
 /// <param name="charSet"> The character set. </param>
 /// <param name="delegationModes">
 /// Finely controls where to recursively apply the character set and where not (including this entity/table).
 /// Implicitly uses <see cref="DelegationModes.ApplyToAll"/> if set to <see langword="null"/>.
 /// </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 HasCharSet(
     [NotNull] this IConventionEntityTypeBuilder entityTypeBuilder,
     [CanBeNull] CharSet charSet,
     DelegationModes?delegationModes = null,
     bool fromDataAnnotation         = false)
 => entityTypeBuilder.HasCharSet(charSet?.Name, delegationModes, fromDataAnnotation);