MoaidHathot / Dumpify

Adding `.Dump()` extension methods to Console Applications, similar to LinqPad's.
MIT License
959 stars 40 forks source link

Virtual Member #20

Closed yudielcurbelo closed 5 months ago

yudielcurbelo commented 8 months ago

When using EF Core Lazy Loading Dump() will load the whole tree. Using MaxDepth = 1 helps, but then you will see a lot of [Exceeded max depth 1] in the console. Is there a way to limit the library to ignore virtual members.

MoaidHathot commented 8 months ago

Hi @yudielcurbelo, interesting use case! Do you mean to ignore all members (also inherited) that is marked with the virtual keyboard? I'm not proficient enough with EF Core, is there another way to determine which members are currently "lazy" loaded? Will the compiler/EF-Core add some attributes to the members? I'm asking to determine whether there is a more precise way to filter lazy-loaded members in this context.

I can add configuration to ignore virtual members, it should be easy. I will look into it this weekend.

Empiree commented 5 months ago

Hi @yudielcurbelo, interesting use case! Do you mean to ignore all members (also inherited) that is marked with the virtual keyboard? I'm not proficient enough with EF Core, is there another way to determine which members are currently "lazy" loaded? Will the compiler/EF-Core add some attributes to the members? I'm asking to determine whether there is a more precise way to filter lazy-loaded members in this context.

I can add configuration to ignore virtual members, it should be easy. I will look into it this weekend.

Hello, I really like your project, can I contribute and solve this problem?

As far as I understand, we need to add IncludeVirtualMembers to MembersConfig and depending on this value output virtual members.

MoaidHathot commented 5 months ago

Hi @Empiree, thanks! Basically, yeah. Most of the changes should be inside MemberProvider. I would love to get help :)

Empiree commented 5 months ago

Hi @Empiree, thanks! Basically, yeah. Most of the changes should be inside MemberProvider. I would love to get help :)

It's done! If any changes are needed, I'll be happy to fix them :)

MoaidHathot commented 5 months ago

Thanks @Empiree and sorry for the delay in response. I'll review it tomorrow :)

MoaidHathot commented 5 months ago

Thanks @Empiree for your contribution, I've approved the PR. The change should be part of the next release, towards the end of March :)