-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query: Enable client eval in InMemory
Also add support for Join/LeftJoin/SelectMany
- Loading branch information
Showing
17 changed files
with
1,278 additions
and
377 deletions.
There are no files selected for viewing
26 changes: 22 additions & 4 deletions
26
src/EFCore.InMemory/Query/Pipeline/EntityValuesExpression.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,39 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Linq.Expressions; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Metadata.Internal; | ||
|
||
namespace Microsoft.EntityFrameworkCore.InMemory.Query.Pipeline | ||
{ | ||
public class EntityProjectionExpression : Expression | ||
{ | ||
public EntityProjectionExpression(IEntityType entityType, int startIndex) | ||
private readonly IDictionary<IProperty, Expression> _readExpressionMap; | ||
|
||
public EntityProjectionExpression( | ||
IEntityType entityType, IDictionary<IProperty, Expression> readExpressionMap) | ||
{ | ||
EntityType = entityType; | ||
StartIndex = startIndex; | ||
_readExpressionMap = readExpressionMap; | ||
} | ||
|
||
public IEntityType EntityType { get; } | ||
public int StartIndex { get; } | ||
} | ||
public override Type Type => EntityType.ClrType; | ||
public override ExpressionType NodeType => ExpressionType.Extension; | ||
|
||
public Expression BindProperty(IProperty property) | ||
{ | ||
if (!EntityType.GetTypesInHierarchy().Contains(property.DeclaringEntityType)) | ||
{ | ||
throw new InvalidOperationException( | ||
$"Called EntityProjectionExpression.BindProperty() with incorrect IProperty. EntityType:{EntityType.DisplayName()}, Property:{property.Name}"); | ||
} | ||
|
||
return _readExpressionMap[property]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.