コード例 #1
0
 /// <summary>
 ///     Returns all check constraints declared on the entity type.
 /// </summary>
 /// <remarks>
 ///     This method does not return check constraints declared on base types.
 ///     It is useful when iterating over all entity types to avoid processing the same check constraint more than once.
 ///     Use <see cref="GetCheckConstraints(IEntityType)" /> to also return check constraints declared on base types.
 /// </remarks>
 /// <param name="entityType">The entity type to get the check constraints for.</param>
 public static IEnumerable <ICheckConstraint> GetDeclaredCheckConstraints(this IEntityType entityType)
 => CheckConstraint.GetDeclaredCheckConstraints(entityType).Cast <ICheckConstraint>();
コード例 #2
0
 /// <summary>
 ///     Returns all check constraints declared on the entity type.
 /// </summary>
 /// <remarks>
 ///     This method does not return check constraints declared on base types.
 ///     It is useful when iterating over all entity types to avoid processing the same check constraint more than once.
 ///     Use <see cref="GetCheckConstraints(IReadOnlyEntityType)" /> to also return check constraints declared on base types.
 /// </remarks>
 /// <param name="entityType">The entity type to get the check constraints for.</param>
 public static IEnumerable <IReadOnlyCheckConstraint> GetDeclaredCheckConstraints(this IReadOnlyEntityType entityType)
 => CheckConstraint.GetDeclaredCheckConstraints(entityType);