mirror of
https://github.com/zoriya/EntityFrameworkCore.Projectables.git
synced 2026-08-15 18:44:57 +00:00
Fixed broken tests
This commit is contained in:
@@ -138,7 +138,7 @@ namespace EntityFrameworkCore.Projectables.Generated
|
||||
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static class {generatedClassName}
|
||||
{{
|
||||
public static System.Linq.Expressions.Expression<System.Func<{lambdaTypeArguments.Arguments}, {projectable.ReturnTypeName}>> Expression{(projectable.TypeParameterList?.Parameters.Any() == true ? projectable.TypeParameterList.ToString() : string.Empty)}()");
|
||||
public static System.Linq.Expressions.Expression<System.Func<{(lambdaTypeArguments.Arguments.Any() ? $"{lambdaTypeArguments.Arguments}, " : "")}{projectable.ReturnTypeName}>> Expression{(projectable.TypeParameterList?.Parameters.Any() == true ? projectable.TypeParameterList.ToString() : string.Empty)}()");
|
||||
|
||||
if (projectable.ConstraintClauses is not null)
|
||||
{
|
||||
|
||||
@@ -47,10 +47,13 @@ namespace EntityFrameworkCore.Projectables.Services
|
||||
var mappedArgumentExpression = (parameterIndex, node.Object) switch {
|
||||
(0, not null) => node.Object,
|
||||
(_, not null) => node.Arguments[parameterIndex - 1],
|
||||
(_, null) => node.Arguments[parameterIndex]
|
||||
(_, null) => node.Arguments.Count > parameterIndex ? node.Arguments[parameterIndex] : null
|
||||
};
|
||||
|
||||
_expressionArgumentReplacer.ParameterArgumentMapping.Add(parameterExpession, mappedArgumentExpression);
|
||||
if (mappedArgumentExpression is not null)
|
||||
{
|
||||
_expressionArgumentReplacer.ParameterArgumentMapping.Add(parameterExpession, mappedArgumentExpression);
|
||||
}
|
||||
}
|
||||
|
||||
var updatedBody = _expressionArgumentReplacer.Visit(reflectedExpression.Body);
|
||||
|
||||
Reference in New Issue
Block a user