public OnEntityTypeRemovedNode(IConventionModelBuilder modelBuilder, IConventionEntityType entityType)
 {
     ModelBuilder = modelBuilder;
     EntityType   = entityType;
 }
 public static IConventionNavigation?FindNavigation(
     [NotNull] this IConventionEntityType entityType,
     [NotNull] MemberInfo memberInfo)
 => Check.NotNull(entityType, nameof(entityType))
 .FindNavigation(Check.NotNull(memberInfo, nameof(memberInfo)).GetSimpleMemberName());
 public static IConventionNavigation?FindDeclaredNavigation([NotNull] this IConventionEntityType entityType, [NotNull] string name)
 => ((EntityType)entityType).FindDeclaredNavigation(Check.NotNull(name, nameof(name)));
 public static IConventionEntityType GetRootType([NotNull] this IConventionEntityType entityType)
 => (IConventionEntityType)((IEntityType)entityType).GetRootType();
 public static IConventionForeignKey?FindOwnership([NotNull] this IConventionEntityType entityType)
 => ((EntityType)entityType).FindOwnership();
 public static IConventionKey?RemoveKey(
     [NotNull] this IConventionEntityType entityType,
     [NotNull] IReadOnlyList <IConventionProperty> properties)
 => ((EntityType)entityType).RemoveKey(properties);
 public static IEnumerable <IConventionForeignKey> FindForeignKeys(
     [NotNull] this IConventionEntityType entityType,
     [NotNull] IProperty property)
 => entityType.FindForeignKeys(new[] { property });
Esempio n. 8
0
 /// <summary>
 ///     Sets a value indicating whether the associated table is ignored by Migrations.
 /// </summary>
 /// <param name="entityType"> The entity type. </param>
 /// <param name="excluded"> A value indicating whether the associated table is ignored by Migrations. </param>
 /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
 /// <returns> The configured value. </returns>
 public static bool?SetIsTableExcludedFromMigrations(
     [NotNull] this IConventionEntityType entityType, bool?excluded, bool fromDataAnnotation = false)
 => (bool?)entityType.SetOrRemoveAnnotation(RelationalAnnotationNames.IsTableExcludedFromMigrations, excluded, fromDataAnnotation)
 ?.Value;
Esempio n. 9
0
 /// <summary>
 ///     Gets the <see cref="ConfigurationSource" /> for <see cref="IsTableExcludedFromMigrations"/>.
 /// </summary>
 /// <param name="entityType"> The entity type to find configuration source for. </param>
 /// <returns> The <see cref="ConfigurationSource" /> for <see cref="IsTableExcludedFromMigrations"/>. </returns>
 public static ConfigurationSource?GetIsTableExcludedFromMigrationsConfigurationSource([NotNull] this IConventionEntityType entityType)
 => entityType.FindAnnotation(RelationalAnnotationNames.IsTableExcludedFromMigrations)
 ?.GetConfigurationSource();
Esempio n. 10
0
 /// <summary>
 ///     Gets the <see cref="ConfigurationSource" /> for the table comment.
 /// </summary>
 /// <param name="entityType"> The entity type to find configuration source for. </param>
 /// <returns> The <see cref="ConfigurationSource" /> for the table comment. </returns>
 public static ConfigurationSource?GetCommentConfigurationSource([NotNull] this IConventionEntityType entityType)
 => entityType.FindAnnotation(RelationalAnnotationNames.Comment)
 ?.GetConfigurationSource();
Esempio n. 11
0
 /// <summary>
 ///     Gets the foreign keys for the given entity type that point to other entity types sharing the same view.
 /// </summary>
 public static IEnumerable <IConventionForeignKey> FindViewRowInternalForeignKeys(
     [NotNull] this IConventionEntityType entityType, [NotNull] string name, [CanBeNull] string schema)
 => entityType.FindRowInternalForeignKeys(name, schema, StoreObjectType.View).Cast <IConventionForeignKey>();
Esempio n. 12
0
 /// <summary>
 ///     Returns all <see cref="IConventionCheckConstraint" /> contained in the entity type.
 /// </summary>
 /// <param name="entityType"> The entity type to get the check constraints for. </param>
 public static IEnumerable <IConventionCheckConstraint> GetCheckConstraints([NotNull] this IConventionEntityType entityType)
 => CheckConstraint.GetCheckConstraints(entityType);
Esempio n. 13
0
 /// <summary>
 ///     Removes the <see cref="IConventionCheckConstraint" /> with the given name.
 /// </summary>
 /// <param name="entityType"> The entity type to remove the check constraint from. </param>
 /// <param name="name"> The check constraint name. </param>
 /// <returns> The removed <see cref="IConventionCheckConstraint" />. </returns>
 public static IConventionCheckConstraint RemoveCheckConstraint(
     [NotNull] this IConventionEntityType entityType,
     [NotNull] string name)
 => CheckConstraint.RemoveCheckConstraint((IMutableEntityType)entityType, Check.NotEmpty(name, nameof(name)));
Esempio n. 14
0
 /// <summary>
 ///     Finds an <see cref="IConventionCheckConstraint" /> with the given name.
 /// </summary>
 /// <param name="entityType"> The entity type to find the check constraint for. </param>
 /// <param name="name"> The check constraint name. </param>
 /// <returns>
 ///     The <see cref="IConventionCheckConstraint" /> or <see langword="null" /> if no check constraint with the
 ///     given name in the given entity type was found.
 /// </returns>
 public static IConventionCheckConstraint FindCheckConstraint(
     [NotNull] this IConventionEntityType entityType, [NotNull] string name)
 => (IConventionCheckConstraint)((IEntityType)entityType).FindCheckConstraint(name);
        public static IConventionKey?FindKey([NotNull] this IConventionEntityType entityType, [NotNull] IProperty property)
        {
            Check.NotNull(entityType, nameof(entityType));

            return(entityType.FindKey(new[] { property }));
        }
Esempio n. 16
0
 public static IConventionEntityType GetRelatedEntityType(
     [NotNull] this IConventionForeignKey foreignKey,
     [NotNull] IConventionEntityType entityType)
 => (IConventionEntityType)((IReadOnlyForeignKey)foreignKey).GetRelatedEntityType(entityType);
 public static IConventionKey?AddKey(
     [NotNull] this IConventionEntityType entityType,
     [NotNull] IConventionProperty property,
     bool fromDataAnnotation = false)
 => Check.NotNull(entityType, nameof(entityType)).AddKey(new[] { property }, fromDataAnnotation);
 /// <summary>
 ///     <para>
 ///         Sets the <see cref="PropertyAccessMode" /> to use for properties of all entity types
 ///         in this model.
 ///     </para>
 ///     <para>
 ///         Note that individual entity types can override this access mode, and individual properties of
 ///         entity types can override the access mode set on the entity type. The value set here will
 ///         be used for any property for which no override has been specified.
 ///     </para>
 /// </summary>
 /// <param name="entityType"> The entity type to set the access mode for. </param>
 /// <param name="propertyAccessMode"> The <see cref="PropertyAccessMode" />, or <c>null</c> to clear the mode set.</param>
 public static void SetPropertyAccessMode(
     [NotNull] this IConventionEntityType entityType,
     PropertyAccessMode?propertyAccessMode)
 => Check.NotNull(entityType, nameof(entityType)).AsEntityType()
 .SetPropertyAccessMode(propertyAccessMode, ConfigurationSource.Explicit);
 public static IEnumerable <IConventionForeignKey> GetDerivedForeignKeys([NotNull] this IConventionEntityType entityType)
 => ((EntityType)entityType).GetDerivedForeignKeys();
 public static IEnumerable <IConventionKey> GetDeclaredKeys([NotNull] this IConventionEntityType entityType)
 => ((EntityType)entityType).GetDeclaredKeys();
 public static IEnumerable <IConventionForeignKey> FindDeclaredForeignKeys(
     [NotNull] this IConventionEntityType entityType,
     [NotNull] IReadOnlyList <IProperty> properties)
 => ((EntityType)entityType).FindDeclaredForeignKeys(properties);
 public static IEnumerable <IConventionNavigation> GetDeclaredNavigations([NotNull] this IConventionEntityType entityType)
 => ((EntityType)entityType).GetDeclaredNavigations();
 public static IEnumerable <IConventionForeignKey> GetDeclaredReferencingForeignKeys([NotNull] this IConventionEntityType entityType)
 => ((EntityType)entityType).GetDeclaredReferencingForeignKeys();
 public static IEnumerable <IConventionServiceProperty> GetDeclaredServiceProperties([NotNull] this IConventionEntityType entityType)
 => ((EntityType)entityType).GetDeclaredServiceProperties();
 public static IConventionForeignKey?RemoveForeignKey(
     [NotNull] this IConventionEntityType entityType,
     [NotNull] IReadOnlyList <IConventionProperty> properties,
     [NotNull] IConventionKey principalKey,
     [NotNull] IConventionEntityType principalEntityType)
 => ((EntityType)entityType).RemoveForeignKey(properties, principalKey, principalEntityType);
 public static IEnumerable <IConventionIndex> GetDeclaredIndexes([NotNull] this IConventionEntityType entityType)
 => ((EntityType)entityType).GetDeclaredIndexes();
 public static IConventionNavigation?FindNavigation([NotNull] this IConventionEntityType entityType, [NotNull] string name)
 => ((EntityType)entityType).FindNavigation(name);
 public static IConventionProperty?RemoveProperty([NotNull] this IConventionEntityType entityType, [NotNull] string name)
 => ((EntityType)entityType).RemoveProperty(name);
 public static IConventionNavigation?FindDefiningNavigation([NotNull] this IConventionEntityType entityType)
 => (IConventionNavigation?)((IEntityType)entityType).FindDefiningNavigation();
Esempio n. 30
0
 public static ConfigurationSource?GetDefiningQueryConfigurationSource([NotNull] this IConventionEntityType entityType)
 => entityType.FindAnnotation(CoreAnnotationNames.DefiningQuery)?.GetConfigurationSource();