Skip to content

Commit

Permalink
Fixed read-only property projection issue. (#7579)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Oct 9, 2024
1 parent f99bf43 commit 522d8f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public Expression<Func<TRoot, TRoot>> BuildNodeExpression<TRoot>(ISelection sele
var context = new Context(parameter, rootType, requirements);
var root = new TypeContainer();

var entityType = selection.DeclaringOperation.GetPossibleTypes(selection).FirstOrDefault(t => t.RuntimeType == typeof(TRoot));
var entityType = selection.DeclaringOperation
.GetPossibleTypes(selection)
.FirstOrDefault(t => t.RuntimeType == typeof(TRoot));

if (entityType is null)
{
Expand Down Expand Up @@ -176,7 +178,7 @@ private void CollectSelection(
return;
}

if (selection.Field.Member is not PropertyInfo property)
if (selection.Field.Member is not PropertyInfo { CanRead: true, CanWrite: true } property)
{
return;
}
Expand Down

0 comments on commit 522d8f4

Please sign in to comment.