-
-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Description
Describe the bug
When using dynamic queries in System.Linq.Dynamic.Core, I am not able to access internal
properties of my entity classes.
Even though I added [assembly: InternalsVisibleTo("DynamicLinqTest")]
(or the corresponding consuming assembly name), the dynamic parser still throws an error that the property does not exist.
To Reproduce
Steps to reproduce the behavior:
- Create a class with an internal property:
public class MyEntity { internal string InternalProp { get; set; } = "test"; }
- Add InternalsVisibleTo to the assembly:
[assembly: InternalsVisibleTo("DynamicLinqTest")]
- Try to query dynamically:
var query = entities.AsQueryable().Where("InternalProp == \"test\"");
- Observe that it fails with:
No property or field 'InternalProp' exists in type 'MyEntity'
Expected behavior
Dynamic query parser should respect InternalsVisibleTo and allow access to internal properties if visibility has been granted.
Additional context
- Reflection-based access from the same assembly works fine.
- The limitation seems to come from the binding logic inside Dynamic.Core not considering internal properties, even with InternalsVisibleTo applied.
Would it be possible to support this scenario, or at least provide an option to enable it?
Metadata
Metadata
Assignees
Labels
No labels