Skip to content

Commit

Permalink
Fix some API docs (#32594)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd authored Dec 12, 2023
1 parent f67d745 commit fb82304
Show file tree
Hide file tree
Showing 12 changed files with 158 additions and 51 deletions.
36 changes: 24 additions & 12 deletions src/EFCore.Relational/Query/StructuralTypeProjectionExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,20 @@ private StructuralTypeProjectionExpression(
public virtual ITypeBase StructuralType { get; }

/// <summary>
/// TODO
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
/// </summary>
[EntityFrameworkInternal]
public virtual IReadOnlyDictionary<ITableBase, TableReferenceExpression> TableMap { get; }

/// <summary>
/// TODO
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
/// </summary>
[EntityFrameworkInternal]
public virtual bool IsNullable { get; }

Expand All @@ -94,15 +88,30 @@ private StructuralTypeProjectionExpression(
/// </summary>
public virtual SqlExpression? DiscriminatorExpression { get; }

/// <inheritdoc />
/// <summary>
/// The <see cref="ExpressionType"/> of the <see cref="Expression"/>.
/// </summary>
public sealed override ExpressionType NodeType
=> ExpressionType.Extension;

/// <inheritdoc />
/// <summary>
/// The <see cref="Type"/> of the value represented by this <see cref="Expression"/>.
/// </summary>
public override Type Type
=> StructuralType.ClrType;

/// <inheritdoc />
/// <summary>
/// Reduces the node and then calls the <see cref="ExpressionVisitor.Visit(Expression)"/> method passing the reduced expression.
/// Throws an exception if the node isn't reducible.
/// </summary>
/// <param name="visitor">An instance of <see cref="ExpressionVisitor"/>.</param>
/// <returns>The expression being visited, or an expression which should replace it in the tree.</returns>
/// <remarks>
/// Override this method to provide logic to walk the node's children.
/// A typical implementation will call visitor.Visit on each of its
/// children, and if any of them change, should return a new copy of
/// itself with the modified children.
/// </remarks>
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
var changed = false;
Expand Down Expand Up @@ -347,7 +356,10 @@ public virtual void AddNavigationBinding(INavigation navigation, StructuralTypeS
: null;
}

/// <inheritdoc />
/// <summary>
/// Creates a <see cref="string"/> representation of the Expression.
/// </summary>
/// <returns>A <see cref="string"/> representation of the Expression.</returns>
public override string ToString()
=> $"EntityProjectionExpression: {StructuralType.ShortName()}";
}
8 changes: 3 additions & 5 deletions src/EFCore/ChangeTracking/ChangeTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,10 @@ public virtual bool HasChanges()
/// is usually called automatically by the context when up-to-date information is required (before
/// <see cref="DbContext.SaveChanges()" /> and when returning change tracking information). You typically only need to
/// call this method if you have disabled <see cref="AutoDetectChangesEnabled" />.
/// <remarks>
/// <para>
/// See <see href="https://aka.ms/efcore-docs-change-tracking">EF Core change tracking</see> for more information and examples.
/// </para>
/// </remarks>
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-change-tracking">EF Core change tracking</see> for more information and examples.
/// </remarks>
public virtual void DetectChanges()
{
if (!_model.SkipDetectChanges)
Expand Down
19 changes: 10 additions & 9 deletions src/EFCore/ChangeTracking/ObservableHashSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
namespace Microsoft.EntityFrameworkCore.ChangeTracking;

/// <summary>
/// A hash set that implements the interfaces required for Entity Framework to use notification based change tracking
/// for a collection navigation property.
/// <para>
/// A hash set that implements the interfaces required for Entity Framework to use notification based change tracking
/// for a collection navigation property.
/// </para>
/// <para>
/// See <see href="https://aka.ms/efcore-docs-local-views">Local views of tracked entities in EF Core</see> for more
/// information and examples.
/// </para>
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-local-views">Local views of tracked entities in EF Core</see> for more information and
/// examples.
/// </remarks>
/// <typeparam name="T">The type of elements in the hash set.</typeparam>
public class ObservableHashSet<T>
: ISet<T>, IReadOnlyCollection<T>, INotifyCollectionChanged, INotifyPropertyChanged, INotifyPropertyChanging
Expand Down Expand Up @@ -113,8 +115,7 @@ public virtual void Clear()
}

/// <summary>
/// Determines whether the hash set object contains the
/// specified element.
/// Determines whether the hash set object contains the specified element.
/// </summary>
/// <param name="item">The element to locate in the hash set.</param>
/// <returns>
Expand Down Expand Up @@ -362,7 +363,7 @@ public virtual bool IsProperSupersetOf(IEnumerable<T> other)
=> _set.IsProperSupersetOf(other);

/// <summary>
/// Determines whether the current System.Collections.Generic.HashSet`1 object and a specified collection share common elements.
/// Determines whether the current hash set object and a specified collection share common elements.
/// </summary>
/// <param name="other">The collection to compare to the current hash set.</param>
/// <returns>
Expand Down
22 changes: 13 additions & 9 deletions src/EFCore/Diagnostics/DbContextLoggerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,23 @@ public enum DbContextLoggerOptions
LocalTime = 1 << 5,

/// <summary>
/// The default used by <see cref="DbContextOptionsBuilder.LogTo(Action{string},LogLevel,DbContextLoggerOptions?)" />.
/// <para>
/// The default used by <see cref="DbContextOptionsBuilder.LogTo(Action{string},LogLevel,DbContextLoggerOptions?)" />.
/// </para>
/// <para>
/// Includes <see cref="Level" />, <see cref="Category" />, <see cref="Id" />, <see cref="LocalTime" />.
/// </para>
/// </summary>
/// <remarks>
/// Includes <see cref="Level" />, <see cref="Category" />, <see cref="Id" />, <see cref="LocalTime" />.
/// </remarks>
DefaultWithLocalTime = Level | Category | Id | LocalTime,

/// <summary>
/// The same defaults as used by <see cref="DbContextOptionsBuilder.LogTo(Action{string},LogLevel,DbContextLoggerOptions?)" />,
/// but with UTC timestamps.
/// <para>
/// The same defaults as used by <see cref="DbContextOptionsBuilder.LogTo(Action{string},LogLevel,DbContextLoggerOptions?)" />,
/// but with UTC timestamps.
/// </para>
/// <para>
/// Includes <see cref="Level" />, <see cref="Category" />, <see cref="Id" />, <see cref="UtcTime" />.
/// </para>
/// </summary>
/// <remarks>
/// Includes <see cref="Level" />, <see cref="Category" />, <see cref="Id" />, <see cref="UtcTime" />.
/// </remarks>
DefaultWithUtcTime = Level | Category | Id | UtcTime
}
16 changes: 14 additions & 2 deletions src/EFCore/Metadata/Conventions/BackingFieldAttributeConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,27 @@ public BackingFieldAttributeConvention(ProviderConventionSetBuilderDependencies
{
}

/// <inheritdoc />
/// <summary>
/// Called after a property is added to the entity type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionPropertyBuilder propertyBuilder,
BackingFieldAttribute attribute,
MemberInfo clrMember,
IConventionContext context)
=> propertyBuilder.HasField(attribute.Name, fromDataAnnotation: true);

/// <inheritdoc />
/// <summary>
/// Called after a complex property is added to a type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionComplexPropertyBuilder propertyBuilder,
BackingFieldAttribute attribute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ public virtual void ProcessModelFinalizing(IConventionModelBuilder modelBuilder,
}
}

/// <inheritdoc />
/// <summary>
/// Called after a property is added to the entity type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionPropertyBuilder propertyBuilder,
DeleteBehaviorAttribute attribute,
Expand All @@ -100,7 +106,13 @@ protected override void ProcessPropertyAdded(
property.DeclaringType.DisplayName(), property.Name));
}

/// <inheritdoc />
/// <summary>
/// Called after a complex property is added to a type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionComplexPropertyBuilder propertyBuilder,
DeleteBehaviorAttribute attribute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ public EntityTypeConfigurationAttributeConvention(ProviderConventionSetBuilderDe
{
}

/// <inheritdoc />
/// <summary>
/// Called after an entity type is added to the model if it has an attribute.
/// </summary>
/// <param name="entityTypeBuilder">The builder for the entity type.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessEntityTypeAdded(
IConventionEntityTypeBuilder entityTypeBuilder,
EntityTypeConfigurationAttribute attribute,
Expand All @@ -46,7 +51,12 @@ protected override void ProcessEntityTypeAdded(
.Invoke(null, new object[] { entityTypeBuilder.Metadata, entityTypeConfigurationType });
}

/// <inheritdoc />
/// <summary>
/// Called after an complex type is added to the model if it has an attribute.
/// </summary>
/// <param name="complexTypeBuilder">The builder for the complex type.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessComplexTypeAdded(
IConventionComplexTypeBuilder complexTypeBuilder,
EntityTypeConfigurationAttribute attribute,
Expand Down
16 changes: 14 additions & 2 deletions src/EFCore/Metadata/Conventions/KeyAttributeConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ public virtual void ProcessEntityTypeBaseTypeChanged(
CheckAttributesAndEnsurePrimaryKey((EntityType)entityTypeBuilder.Metadata, null, shouldThrow: false);
}

/// <inheritdoc />
/// <summary>
/// Called after a property is added to the entity type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionPropertyBuilder propertyBuilder,
KeyAttribute attribute,
Expand Down Expand Up @@ -132,7 +138,13 @@ private bool CheckAttributesAndEnsurePrimaryKey(
return primaryKeyAttributeExists;
}

/// <inheritdoc />
/// <summary>
/// Called after a complex property is added to a type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionComplexPropertyBuilder propertyBuilder,
KeyAttribute attribute,
Expand Down
16 changes: 14 additions & 2 deletions src/EFCore/Metadata/Conventions/MaxLengthAttributeConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ public MaxLengthAttributeConvention(ProviderConventionSetBuilderDependencies dep
{
}

/// <inheritdoc />
/// <summary>
/// Called after a property is added to the entity type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionPropertyBuilder propertyBuilder,
MaxLengthAttribute attribute,
Expand All @@ -38,7 +44,13 @@ protected override void ProcessPropertyAdded(
}
}

/// <inheritdoc />
/// <summary>
/// Called after a complex property is added to a type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionComplexPropertyBuilder propertyBuilder,
MaxLengthAttribute attribute,
Expand Down
14 changes: 12 additions & 2 deletions src/EFCore/Metadata/Conventions/OwnedAttributeConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ public OwnedAttributeConvention(ProviderConventionSetBuilderDependencies depende
{
}

/// <inheritdoc />
/// <summary>
/// Called after an entity type is added to the model if it has an attribute.
/// </summary>
/// <param name="entityTypeBuilder">The builder for the entity type.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessEntityTypeAdded(
IConventionEntityTypeBuilder entityTypeBuilder,
OwnedAttribute attribute,
Expand All @@ -36,7 +41,12 @@ protected override void ProcessEntityTypeAdded(
}
}

/// <inheritdoc />
/// <summary>
/// Called after an complex type is added to the model if it has an attribute.
/// </summary>
/// <param name="complexTypeBuilder">The builder for the complex type.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessComplexTypeAdded(
IConventionComplexTypeBuilder complexTypeBuilder,
OwnedAttribute attribute,
Expand Down
16 changes: 14 additions & 2 deletions src/EFCore/Metadata/Conventions/PrecisionAttributeConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ public PrecisionAttributeConvention(ProviderConventionSetBuilderDependencies dep
{
}

/// <inheritdoc />
/// <summary>
/// Called after a property is added to the entity type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionPropertyBuilder propertyBuilder,
PrecisionAttribute attribute,
Expand All @@ -38,7 +44,13 @@ protected override void ProcessPropertyAdded(
}
}

/// <inheritdoc />
/// <summary>
/// Called after a complex property is added to a type with an attribute on the associated CLR property or field.
/// </summary>
/// <param name="propertyBuilder">The builder for the property.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="clrMember">The member that has the attribute.</param>
/// <param name="context">Additional information associated with convention execution.</param>
protected override void ProcessPropertyAdded(
IConventionComplexPropertyBuilder propertyBuilder,
PrecisionAttribute attribute,
Expand Down
Loading

0 comments on commit fb82304

Please sign in to comment.