-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
Hi, I'm currently facing the issue that when I use [Projectable(UseMemberBody = nameof(InternalVersionTagString))] on one of the properties in my Entity class, the change tracking of EF CORE 9 stops working completely without errors, even for an unrelated property (e.g. public string? Name { get; set; } )
When using [Projectable] without UseMemberBody the problem does not arise, however this strategy doesnt work well with Hot Chocolate.
[NotMapped]
public uint VersionTag { get; set; }
[GraphQLName("_versionTag")]
[NotMapped]
[Projectable(UseMemberBody = nameof(InternalVersionTagString))] <- when i comment this line out, the change tracking works again
public string VersionTagString { get; set; }
// We have to use this strategy of projectable because Hot Chocolate seems to skip lambdas in their projection engine
// This leads to the behaviour that e.g. InternalVersionTagString is null until the dependency VersionTag is also fetched
// The lambda is then used by hot chocolate as a resolver(called after query result arrived), regardless whether it has the [Projectable] Attribute
private string InternalVersionTagString => VersionTag.ToString();
LOGS
2025-04-08 05:35:26 info: server.api.ItemController[0]
2025-04-08 05:35:26 Old Item name is Tester
2025-04-08 05:35:26 info: server.api.ItemController[0]
2025-04-08 05:35:26 ItemDto name is Testr
2025-04-08 05:35:26 info: server.api.ItemController[0]
2025-04-08 05:35:26 Item name is Testr
....
2025-04-08 05:35:26 info: server.api.ItemController[0]
2025-04-08 05:35:26 ChangeTracker HasChanges before SaveChanges: False
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels