Skip to content

Suggestion: IAsyncQueryable  #28237

@lillo42

Description

@lillo42

I'm studying C# 8 and new we have a new interface call IAsyncEnumerable and I was think maybe it's a good ideia create a new interface call IAsyncQueryable to be possible using await foreach async with ORM like EF or NHibernarte:

IAsyncQueryable query = database.Where(...);

await foreach(var a in query) {
...
}

I was thinking IAsyncQueryable could be:

public interface IAsyncQueryable : IAsyncEnumerable
{
   Type ElementType { get; }
    Expression Expression { get; }
    IQueryProvider Provider { get; }
}


public interface IAsyncQueryable<T> : IAsyncQueryable, IAsyncEnumerable<T>
{

}

or

public interface IAsyncQueryable : IQueryable, IAsyncEnumerable
{

}


public interface IAsyncQueryable<T> : IQueryable<T>, IAsyncQueryable,  IAsyncEnumerable<T>
{

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions