/// <summary> /// Finds a property declared on the type with the given name. /// Does not return properties defined on a base type. /// </summary> /// <param name="entityType"> The entity type. </param> /// <param name="name"> The property name. </param> /// <returns> The property, or <see langword="null" /> if none is found. </returns> public static IProperty FindDeclaredProperty([NotNull] this IEntityType entityType, [NotNull] string name) => entityType.AsEntityType().FindDeclaredProperty(name);
/// <summary> /// Gets the data stored in the model for the given entity type. /// </summary> /// <param name="entityType"> The entity type. </param> /// <param name="providerValues"> If true, then provider values are used. </param> /// <returns> The data. </returns> public static IEnumerable <IDictionary <string, object> > GetSeedData( [NotNull] this IEntityType entityType, bool providerValues = false) => entityType.AsEntityType().GetSeedData(providerValues);
/// <summary> /// <para> /// Gets all indexes declared on the given <see cref="IEntityType" />. /// </para> /// <para> /// This method does not return indexes declared on base types. /// It is useful when iterating over all entity types to avoid processing the same index more than once. /// Use <see cref="IEntityType.GetForeignKeys" /> to also return indexes declared on base types. /// </para> /// </summary> /// <param name="entityType"> The entity type. </param> /// <returns> Declared indexes. </returns> public static IEnumerable <IIndex> GetDeclaredIndexes([NotNull] this IEntityType entityType) => entityType.AsEntityType().GetDeclaredIndexes();
/// <summary> /// <para> /// Finds matching properties on the given entity type. Returns <see langword="null" /> if any property is not found. /// </para> /// <para> /// This API only finds scalar properties and does not find navigation properties. /// </para> /// </summary> /// <param name="entityType"> The entity type. </param> /// <param name="propertyNames"> The property names. </param> /// <returns> The properties, or <see langword="null" /> if any property is not found. </returns> public static IReadOnlyList <IProperty> FindProperties( [NotNull] this IEntityType entityType, [NotNull] IReadOnlyList <string> propertyNames) => entityType.AsEntityType().FindProperties(Check.NotNull(propertyNames, nameof(propertyNames)));
/// <summary> /// <para> /// Gets all foreign keys declared on the types derived from the given <see cref="IEntityType" />. /// </para> /// <para> /// This method does not return foreign keys declared on the given entity type itself. /// Use <see cref="IEntityType.GetForeignKeys" /> to return foreign keys declared on this /// and base entity typed types. /// </para> /// </summary> /// <param name="entityType"> The entity type. </param> /// <returns> Derived foreign keys. </returns> public static IEnumerable <IForeignKey> GetDerivedForeignKeys([NotNull] this IEntityType entityType) => entityType.AsEntityType().GetDerivedForeignKeys();
/// <summary> /// <para> /// Gets all service properties declared on the given <see cref="IEntityType" />. /// </para> /// <para> /// This method does not return properties declared on base types. /// It is useful when iterating over all entity types to avoid processing the same property more than once. /// Use <see cref="IEntityType.GetServiceProperties" /> to also return properties declared on base types. /// </para> /// </summary> /// <param name="entityType"> The entity type. </param> /// <returns> Declared service properties. </returns> public static IEnumerable <IServiceProperty> GetDeclaredServiceProperties([NotNull] this IEntityType entityType) => entityType.AsEntityType().GetDeclaredServiceProperties();
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public static IEnumerable <Navigation> GetDerivedNavigations([NotNull] this IEntityType entityType) => entityType.AsEntityType().GetDerivedNavigations();
/// <summary> /// <para> /// Gets all keys declared on the given <see cref="IEntityType" />. /// </para> /// <para> /// This method does not return keys declared on base types. /// It is useful when iterating over all entity types to avoid processing the same key more than once. /// Use <see cref="IEntityType.GetKeys" /> to also return keys declared on base types. /// </para> /// </summary> /// <param name="entityType"> The entity type. </param> /// <returns> Declared keys. </returns> public static IEnumerable <IKey> GetDeclaredKeys([NotNull] this IEntityType entityType) => entityType.AsEntityType().GetDeclaredKeys();
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public static Func <ValueBuffer, ISnapshot> GetShadowValuesFactory([NotNull] this IEntityType entityType) => entityType.AsEntityType().ShadowValuesFactory;
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public static Func <ISnapshot> GetEmptyShadowValuesFactory([NotNull] this IEntityType entityType) => entityType.AsEntityType().EmptyShadowValuesFactory;
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public static Func <InternalEntityEntry, ISnapshot> GetOriginalValuesFactory([NotNull] this IEntityType entityType) => entityType.AsEntityType().OriginalValuesFactory;
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public static Func <InternalEntityEntry, ISnapshot> GetRelationshipSnapshotFactory([NotNull] this IEntityType entityType) => entityType.AsEntityType().RelationshipSnapshotFactory;
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public static PropertyCounts GetCounts([NotNull] this IEntityType entityType) => entityType.AsEntityType().Counts;
public static Func <MaterializationContext, object> GetInstanceFactory([NotNull] this IEntityType entityType) => entityType.AsEntityType().InstanceFactory;
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public static IEnumerable <IDictionary <string, object> > GetSeedData([NotNull] this IEntityType entityType) => entityType.AsEntityType().GetSeedData();