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

Getters in manually implemented get-set properties are not translated #77

Open
AntonC9018 opened this issue Jun 22, 2023 · 1 comment · May be fixed by #79
Open

Getters in manually implemented get-set properties are not translated #77

AntonC9018 opened this issue Jun 22, 2023 · 1 comment · May be fixed by #79
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AntonC9018
Copy link

My use case is that I want to effectively add an alias for a member. So here for example I add an Id property which just points to DocumentId. I need the getter of Id to be projectable for it to get translated correctly in queries, but I also happen to need a setter (it's implementing an interface). I cannot separate out the two, because if an interface defines a property as get; set; you have to implement both in one go.

        [NotMapped] public string Id { [Projectable] get => DocumentId; set => DocumentId = value; }
        public string DocumentId { get; set; }

For reference, the id comes from an interface like this:

interface IId<T>
{
    T Id { get; set; }
}

I do need both get and set in the interface and I can't separate them out.

@koenbeuk koenbeuk added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 26, 2023
@koenbeuk
Copy link
Owner

This sounds like a source generation issue and/or a runtime resolution issue and should be relatively easy to fix. Happy to take a PR here.

hahn-kev added a commit to hahn-kev/EntityFrameworkCore.Projectables that referenced this issue Aug 15, 2023
hahn-kev added a commit to hahn-kev/EntityFrameworkCore.Projectables that referenced this issue Aug 15, 2023
@hahn-kev hahn-kev linked a pull request Aug 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants