Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding queryable extensions to DataServiceQuery<T> #2475

Open
wants to merge 1 commit into
base: release-7.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,035 changes: 1,035 additions & 0 deletions src/Microsoft.OData.Client/DataServiceQueryExtensions.cs

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions src/Microsoft.OData.Client/PublicAPI.Unshipped.txt

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/Microsoft.Spatial/OrderedQueryableExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Microsoft.Spatial
{
using System.Linq;
using System.Runtime.CompilerServices;

/// <summary>
/// Extension methods for <see cref="IOrderedQueryable{T}"/>
/// </summary>
/// <threadsafety static="true"/>
public static class OrderedQueryableExtensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why do we add this in the Microsoft.Spatial project.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

{
/// <summary>
/// Returns <paramref name="queryable"/> typed as <see cref="IOrderedQueryable{T}"/>
/// </summary>
/// <typeparam name="T">The type of the elements of <paramref name="queryable"/></typeparam>
/// <param name="queryable">The queryable to type as <see cref="IOrderedQueryable{T}"/></param>
/// <returns>The input queryable typed as <see cref="IOrderedQueryable{T}"/></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IOrderedQueryable<T> AsOrderedQueryable<T>(this IOrderedQueryable<T> queryable)
{
return queryable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return queryable;

just returns the input? do nothing

}
}
}
4 changes: 4 additions & 0 deletions src/Microsoft.Spatial/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,12 @@ Microsoft.Spatial.IShapeProvider
Microsoft.Spatial.ISpatial
Microsoft.Spatial.ISpatial.CoordinateSystem.get -> Microsoft.Spatial.CoordinateSystem
Microsoft.Spatial.ISpatial.IsEmpty.get -> bool
Microsoft.Spatial.OrderedQueryableExtensions
Microsoft.Spatial.ParseErrorException
Microsoft.Spatial.ParseErrorException.ParseErrorException() -> void
Microsoft.Spatial.ParseErrorException.ParseErrorException(string message) -> void
Microsoft.Spatial.ParseErrorException.ParseErrorException(string message, System.Exception innerException) -> void
Microsoft.Spatial.QueryableExtensions
Microsoft.Spatial.SpatialBuilder
Microsoft.Spatial.SpatialBuilder.ConstructedGeography.get -> Microsoft.Spatial.Geography
Microsoft.Spatial.SpatialBuilder.ConstructedGeometry.get -> Microsoft.Spatial.Geometry
Expand Down Expand Up @@ -349,6 +351,8 @@ static Microsoft.Spatial.GeometryPoint.Create(Microsoft.Spatial.CoordinateSystem
static Microsoft.Spatial.GeometryPosition.operator !=(Microsoft.Spatial.GeometryPosition left, Microsoft.Spatial.GeometryPosition right) -> bool
static Microsoft.Spatial.GeometryPosition.operator ==(Microsoft.Spatial.GeometryPosition left, Microsoft.Spatial.GeometryPosition right) -> bool
static Microsoft.Spatial.GmlFormatter.Create() -> Microsoft.Spatial.GmlFormatter
static Microsoft.Spatial.OrderedQueryableExtensions.AsOrderedQueryable<T>(this System.Linq.IOrderedQueryable<T> queryable) -> System.Linq.IOrderedQueryable<T>
static Microsoft.Spatial.QueryableExtensions.AsQueryable<T>(this System.Linq.IQueryable<T> queryable) -> System.Linq.IQueryable<T>
static Microsoft.Spatial.SpatialBuilder.Create() -> Microsoft.Spatial.SpatialBuilder
static Microsoft.Spatial.SpatialImplementation.CurrentImplementation.get -> Microsoft.Spatial.SpatialImplementation
static Microsoft.Spatial.SpatialPipeline.implicit operator Microsoft.Spatial.GeographyPipeline(Microsoft.Spatial.SpatialPipeline spatialPipeline) -> Microsoft.Spatial.GeographyPipeline
Expand Down
24 changes: 24 additions & 0 deletions src/Microsoft.Spatial/QueryableExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Microsoft.Spatial
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright

using System.Linq;
using System.Runtime.CompilerServices;

/// <summary>
/// Extension methods for <see cref="IQueryable{T}"/>
/// </summary>
/// <threadsafety static="true"/>
public static class QueryableExtensions
{
/// <summary>
/// Returns <paramref name="queryable"/> typed as <see cref="IQueryable{T}"/>
/// </summary>
/// <typeparam name="T">The type of the elements of <paramref name="queryable"/></typeparam>
/// <param name="queryable">The queryable to type as <see cref="IQueryable{T}"/></param>
/// <returns>The input queryable typed as <see cref="IQueryable{T}"/></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IQueryable<T> AsQueryable<T>(this IQueryable<T> queryable)
{
return queryable;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why do we add this in the Microsoft.Spatial project.

}
}

Large diffs are not rendered by default.

260 changes: 260 additions & 0 deletions test/PublicApiTests/BaseLine/Microsoft.OData.PublicApi.net45.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,26 @@ public sealed class Microsoft.Spatial.GeometryOperationsExtensions {
public static System.Nullable`1[[System.Double]] Length (Microsoft.Spatial.Geometry operand)
}

[
ExtensionAttribute(),
]
public sealed class Microsoft.Spatial.OrderedQueryableExtensions {
[
ExtensionAttribute(),
]
public static IOrderedQueryable`1 AsOrderedQueryable (IOrderedQueryable`1 queryable)
}

[
ExtensionAttribute(),
]
public sealed class Microsoft.Spatial.QueryableExtensions {
[
ExtensionAttribute(),
]
public static IQueryable`1 AsQueryable (IQueryable`1 queryable)
}

[
ExtensionAttribute(),
]
Expand Down Expand Up @@ -8007,6 +8027,246 @@ public sealed class Microsoft.OData.Client.DataServiceExtensions {
public static int CountDistinct (IQueryable`1 source, Expression`1 selector)
}

[
ExtensionAttribute(),
]
public sealed class Microsoft.OData.Client.DataServiceQueryExtensions {
[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Concat (DataServiceQuery`1 source1, IEnumerable`1 source2)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 DefaultIfEmpty (DataServiceQuery`1 source)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 DefaultIfEmpty (DataServiceQuery`1 source, TSource defaultValue)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Distinct (DataServiceQuery`1 source)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Distinct (DataServiceQuery`1 source, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Except (DataServiceQuery`1 source1, IEnumerable`1 source2)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Except (DataServiceQuery`1 source1, IEnumerable`1 source2, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector, Expression`1 resultSelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector, Expression`1 elementSelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector, Expression`1 elementSelector, Expression`1 resultSelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector, Expression`1 resultSelector, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector, Expression`1 elementSelector, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupBy (DataServiceQuery`1 source, Expression`1 keySelector, Expression`1 elementSelector, Expression`1 resultSelector, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupJoin (DataServiceQuery`1 outer, IEnumerable`1 inner, Expression`1 outerKeySelector, Expression`1 innerKeySelector, Expression`1 resultSelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 GroupJoin (DataServiceQuery`1 outer, IEnumerable`1 inner, Expression`1 outerKeySelector, Expression`1 innerKeySelector, Expression`1 resultSelector, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Intersect (DataServiceQuery`1 source1, IEnumerable`1 source2)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Intersect (DataServiceQuery`1 source1, IEnumerable`1 source2, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Join (DataServiceQuery`1 outer, IEnumerable`1 inner, Expression`1 outerKeySelector, Expression`1 innerKeySelector, Expression`1 resultSelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Join (DataServiceQuery`1 outer, IEnumerable`1 inner, Expression`1 outerKeySelector, Expression`1 innerKeySelector, Expression`1 resultSelector, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery OrderBy (DataServiceQuery`1 source, Expression`1 keySelector)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery OrderBy (DataServiceQuery`1 source, Expression`1 keySelector, IComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery OrderByDescending (DataServiceQuery`1 source, Expression`1 keySelector)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery OrderByDescending (DataServiceQuery`1 source, Expression`1 keySelector, IComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Reverse (DataServiceQuery`1 source)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Select (DataServiceQuery`1 source, Expression`1 selector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Select (DataServiceQuery`1 source, Expression`1 selector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 SelectMany (DataServiceQuery`1 source, Expression`1 selector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 SelectMany (DataServiceQuery`1 source, Expression`1 selector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 SelectMany (DataServiceQuery`1 source, Expression`1 collectionSelector, Expression`1 resultSelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 SelectMany (DataServiceQuery`1 source, Expression`1 collectionSelector, Expression`1 resultSelector)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Skip (DataServiceQuery`1 source, int count)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 SkipWhile (DataServiceQuery`1 source, Expression`1 predicate)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 SkipWhile (DataServiceQuery`1 source, Expression`1 predicate)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Take (DataServiceQuery`1 source, int count)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 TakeWhile (DataServiceQuery`1 source, Expression`1 predicate)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 TakeWhile (DataServiceQuery`1 source, Expression`1 predicate)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery ThenBy (DataServiceOrderedQuery source, Expression`1 keySelector)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery ThenBy (DataServiceOrderedQuery source, Expression`1 keySelector, IComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery ThenByDescending (DataServiceOrderedQuery source, Expression`1 keySelector)

[
ExtensionAttribute(),
]
public static DataServiceOrderedQuery ThenByDescending (DataServiceOrderedQuery source, Expression`1 keySelector, IComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Union (DataServiceQuery`1 source1, IEnumerable`1 source2)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Union (DataServiceQuery`1 source1, IEnumerable`1 source2, IEqualityComparer`1 comparer)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Where (DataServiceQuery`1 source, Expression`1 predicate)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Where (DataServiceQuery`1 source, Expression`1 predicate)

[
ExtensionAttribute(),
]
public static DataServiceQuery`1 Zip (DataServiceQuery`1 source1, IEnumerable`1 source2, Expression`1 resultSelector)
}

[
ExtensionAttribute(),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,26 @@ public sealed class Microsoft.Spatial.GeometryOperationsExtensions {
public static System.Nullable`1[[System.Double]] Length (Microsoft.Spatial.Geometry operand)
}

[
ExtensionAttribute(),
]
public sealed class Microsoft.Spatial.OrderedQueryableExtensions {
[
ExtensionAttribute(),
]
public static IOrderedQueryable`1 AsOrderedQueryable (IOrderedQueryable`1 queryable)
}

[
ExtensionAttribute(),
]
public sealed class Microsoft.Spatial.QueryableExtensions {
[
ExtensionAttribute(),
]
public static IQueryable`1 AsQueryable (IQueryable`1 queryable)
}

[
ExtensionAttribute(),
]
Expand Down
Loading