Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
27 changes: 9 additions & 18 deletions Orm/Xtensive.Orm/Orm/QueryEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,10 @@
/// and finally, resolve <see cref="Key"/>s to <see cref="Entity">entities</see>.
/// </summary>
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public sealed class QueryEndpoint
public readonly struct QueryEndpoint
{
private readonly Session session;

/// <summary>
/// Gets outer <see cref="QueryEndpoint"/>.
/// For root <see cref="QueryEndpoint"/> returns <see langword="null"/>.
/// </summary>
public QueryEndpoint Outer { get; private set; }

/// <summary>
/// Gets <see cref="IQueryProvider"/> implementation
/// for this session.
Expand All @@ -48,7 +42,7 @@
/// If <see cref="IQueryRootBuilder"/> is not set for this instance
/// returns <see langword="null"/>.
/// </summary>
public IQueryRootBuilder RootBuilder { get; private set; }
public IQueryRootBuilder RootBuilder { get; }

/// <summary>
/// The "starting point" for any LINQ query -
Expand Down Expand Up @@ -516,16 +510,13 @@
where T : class, IEntity
{
var elementType = typeof (TElement);
Func<TElement, Key> selector;
if (elementType==WellKnownTypes.ObjectArray) {
selector = e => Key.Create(session.Domain, session.StorageNodeId, typeof (T), TypeReferenceAccuracy.BaseType, (object[]) (object) e);
}
else if (WellKnownOrmTypes.Tuple.IsAssignableFrom(elementType)) {
selector = e => Key.Create(session.Domain, session.StorageNodeId, typeof (T), TypeReferenceAccuracy.BaseType, (Tuple) (object) e);
}
else {
selector = e => Key.Create(session.Domain, session.StorageNodeId, typeof (T), TypeReferenceAccuracy.BaseType, new object[] {e});
}
var sess = session;
Func<TElement, Key> selector =
elementType == WellKnownTypes.ObjectArray
? e => Key.Create(sess.Domain, sess.StorageNodeId, typeof(T), TypeReferenceAccuracy.BaseType, (object[]) (object) e)
: WellKnownOrmTypes.Tuple.IsAssignableFrom(elementType)
? e => Key.Create(sess.Domain, sess.StorageNodeId, typeof(T), TypeReferenceAccuracy.BaseType, (Tuple) (object) e)
: e => Key.Create(sess.Domain, sess.StorageNodeId, typeof(T), TypeReferenceAccuracy.BaseType, new object[] { e });

return new PrefetchQuery<T>(session, keys.Select(selector));
}
Expand Down Expand Up @@ -995,7 +986,7 @@

internal QueryEndpoint(QueryEndpoint outerEndpoint, IQueryRootBuilder queryRootBuilder)
{
ArgumentNullException.ThrowIfNull(outerEndpoint);

Check warning on line 989 in Orm/Xtensive.Orm/Orm/QueryEndpoint.cs

View workflow job for this annotation

GitHub Actions / SQL tests

Calling 'ArgumentNullException.ThrowIfNull' and passing a non-nullable value is a no-op (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2264)

Check warning on line 989 in Orm/Xtensive.Orm/Orm/QueryEndpoint.cs

View workflow job for this annotation

GitHub Actions / SQL tests

Calling 'ArgumentNullException.ThrowIfNull' and passing a non-nullable value is a no-op (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2264)

Check warning on line 989 in Orm/Xtensive.Orm/Orm/QueryEndpoint.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Calling 'ArgumentNullException.ThrowIfNull' and passing a non-nullable value is a no-op (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2264)

Check warning on line 989 in Orm/Xtensive.Orm/Orm/QueryEndpoint.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Calling 'ArgumentNullException.ThrowIfNull' and passing a non-nullable value is a no-op (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2264)

Check warning on line 989 in Orm/Xtensive.Orm/Orm/QueryEndpoint.cs

View workflow job for this annotation

GitHub Actions / Build & Publish

Calling 'ArgumentNullException.ThrowIfNull' and passing a non-nullable value is a no-op (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2264)

Check warning on line 989 in Orm/Xtensive.Orm/Orm/QueryEndpoint.cs

View workflow job for this annotation

GitHub Actions / Build & Publish

Calling 'ArgumentNullException.ThrowIfNull' and passing a non-nullable value is a no-op (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2264)
ArgumentNullException.ThrowIfNull(queryRootBuilder);
Provider = outerEndpoint.Provider;
session = outerEndpoint.session;
Expand Down
4 changes: 2 additions & 2 deletions Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<DoVersion>7.2.181</DoVersion>
<DoVersionSuffix>servicetitan</DoVersionSuffix>
<DoVersion>7.2.182</DoVersion>
<DoVersionSuffix>servicetitan-test</DoVersionSuffix>
</PropertyGroup>

</Project>