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

Unable to get the nuget version working for Projectables with UseMemberBody #99

Closed
brezina1 opened this issue Feb 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@brezina1
Copy link

brezina1 commented Feb 7, 2024

I was trying to track down an issue where using a Projectable property with backing field never loads the value. I figured out that it works as expected when I reference the EntityFrameworkCore.Projectables and EntityFrameworkCore.Projectables.Generator projects as it's done in the BasicSample project. The BasicSample project features the following code:

[Projectable(UseMemberBody = nameof(_FullName))]
public string FullName { get; set; }
private string _FullName => FirstName + " " + LastName;

While running the BasicSample with the Projectables projects referenced the console output is the following:

Console output from BasicSample with dirrect project references

User name: Jon Doe
User name: Jon Doe
User name: Jon Doe
User name: Jon Doe
Our first user Jon Doe has spent 5,7
Our first user Jon Doe has spent 5,7
Our users combined spent: 5,7
Our user (Jon Doe) spent 5,7
Our users spent 5,7 on its biggest order
Our users bought the following products starting with 'Red': Red pen
User name: Jon Doe, Orders: Red pen, Blue pen

After removing the project references and instead adding the nuget equivalents - EntityFrameworkCore.Projectables 3.0.4 and EntityFrameworkCore.Projectables.Abstractions 3.0.4 to the BasicSample project and running it, the before mentioned FullName property (and others) stop working. Here is the console output:

Console output from BasicSample with nuget references

User name:
User name:
User name:
User name:
Our first user has spent 0
Our first user has spent 0
Our users combined spent: 5,7
Our user (Jon Doe) spent 5,7
Our users spent 5,7 on its biggest order
Our users bought the following products starting with 'Red': Red pen
User name: , Orders: Red pen, Blue pen

I also tried different nuget versions with no luck, so I might just be doing something wrong.

@koenbeuk koenbeuk added the bug Something isn't working label Feb 13, 2024
@koenbeuk
Copy link
Owner

koenbeuk commented Mar 8, 2024

This issue would have been caused by #86, which was fixed in the latest master branch but not yet in v3.0.4. Please give v4.0.0-preview.1 a chance and let me know if this is still an issue there.

@koenbeuk koenbeuk closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants