Skip to content

Commit

Permalink
Remove IAsyncEnumerable from DbSet (#24145)
Browse files Browse the repository at this point in the history
Fixes #24041
  • Loading branch information
roji committed Feb 18, 2021
1 parent 5e76851 commit 41c13cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
22 changes: 4 additions & 18 deletions src/EFCore/DbSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.EntityFrameworkCore.Metadata;

namespace Microsoft.EntityFrameworkCore
Expand All @@ -39,8 +40,7 @@ namespace Microsoft.EntityFrameworkCore
/// </para>
/// </summary>
/// <typeparam name="TEntity"> The type of entity being operated on by this set. </typeparam>
public abstract class DbSet<TEntity>
: IQueryable<TEntity>, IAsyncEnumerable<TEntity>, IInfrastructure<IServiceProvider>, IListSource
public abstract class DbSet<TEntity> : IQueryable<TEntity>, IInfrastructure<IServiceProvider>, IListSource
where TEntity : class
{
/// <summary>
Expand All @@ -50,17 +50,11 @@ public virtual IEntityType EntityType
=> null;

/// <summary>
/// <para>
/// Returns this object typed as <see cref="IAsyncEnumerable{T}" />.
/// </para>
/// <para>
/// This is a convenience method to help with disambiguation of extension methods in the same
/// namespace that extend both interfaces.
/// </para>
/// Returns this object typed as <see cref="IAsyncEnumerable{T}" />.
/// </summary>
/// <returns> This object. </returns>
public virtual IAsyncEnumerable<TEntity> AsAsyncEnumerable()
=> this;
=> (IAsyncEnumerable<TEntity>)this;

/// <summary>
/// <para>
Expand Down Expand Up @@ -529,14 +523,6 @@ IEnumerator<TEntity> IEnumerable<TEntity>.GetEnumerator()
IEnumerator IEnumerable.GetEnumerator()
=> throw new NotSupportedException();

/// <summary>
/// Returns an <see cref="IAsyncEnumerator{T}" /> which when enumerated will asynchronously execute a query against
/// the database.
/// </summary>
/// <returns> The query results. </returns>
IAsyncEnumerator<TEntity> IAsyncEnumerable<TEntity>.GetAsyncEnumerator(CancellationToken cancellationToken)
=> throw new NotSupportedException();

/// <summary>
/// Gets the IQueryable element type.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ public Repository(NorthwindContext bloggingContext)
}

public IQueryable<T> Find()
{
return _context.Set<T>().AsQueryable();
}
=> _context.Set<T>();
}

[ConditionalFact]
Expand Down

0 comments on commit 41c13cd

Please sign in to comment.