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

Reduce scope of key property lookup to direct property lambda #101

Merged
merged 2 commits into from
May 17, 2022
Merged
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
6 changes: 4 additions & 2 deletions .github/workflows/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ runs:
warn="\e[0;33m"
while [ $counter -lt 6 ]
do
# run test and forward output also to a file in addition to stdout (tee command)
if [ $filter ]
then
echo -e "${warn}Retry $counter for $filter ${reset}"
dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m --filter=$filter | tee ./output.log
else
dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m | tee ./output.log
fi
# run test and forward output also to a file in addition to stdout (tee command)
dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m --filter=$filter | tee ./output.log
# capture dotnet test exit status, different from tee
exitcode=${PIPESTATUS[0]}
if [ $exitcode == 0 ]
Expand Down
19 changes: 2 additions & 17 deletions src/TableStorage/ExpressionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,8 @@ static class ExpressionExtensions
member.Member is PropertyInfo property)
return property.Name;

var visitor = new FindPropertyVisitor();
visitor.Visit(expression);

return visitor.Property?.Name;
}

class FindPropertyVisitor : ExpressionVisitor
{
public PropertyInfo? Property { get; set; }

protected override Expression VisitMember(MemberExpression node)
{
if (node.Member is PropertyInfo property)
Property = property;

return base.VisitMember(node);
}
// We do not support anything except a straight property getter expression.
return null;
}
}
}