Skip to content

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

@brezina1

Description

@brezina1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions