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

Fluent option? #97

Open
relfman-cmg opened this issue Dec 9, 2023 · 4 comments
Open

Fluent option? #97

relfman-cmg opened this issue Dec 9, 2023 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@relfman-cmg
Copy link

Is it possible to have a fluent option instead of using attributes? It would be nice if I could set this in the entity configuration on the EntityTypeBuilder

builder.Projectable(...)

@koenbeuk koenbeuk added help wanted Extra attention is needed enhancement New feature or request labels Mar 8, 2024
@aradalvand
Copy link

aradalvand commented Jun 19, 2024

+1 Something like this — that is, being able to mark a property as projectable from the 'outside' — is actually very much needed in onion/clean architecture type projects.

I'm not sure if a fluent builder could work since this is a source generator; if not, then an [assembly: ProjectableAt(typeof(Person), nameof(Person.FullName))] attribute may be a good API.

@koenbeuk
Copy link
Owner

koenbeuk commented Aug 18, 2024

being able to mark a property as projectable from the 'outside' — is actually very much needed

This library needs access to the syntax when it generates a companion expression. Anything that lives on the outside does not come with Syntax. EntityFrameworkCore.Projectables.Abstractions has no reference to EFCore and exists for that reason. You can reference it in your abstraction projects and mark things as Projectable as needed`

@aradalvand
Copy link

aradalvand commented Aug 19, 2024

Anything that lives on the outside does not come with Syntax.

Yeah you're actually right, fair enough.

EntityFrameworkCore.Projectables.Abstractions has no reference to EFCore and exists for that reason.

There would still be a conceptual dependency on EF though, so kind of a leaky abstraction.

@mrhighstone
Copy link

+1 on this one. Having it availabe as extension on EntityTypeBuilder makes the behaviour configurable.

It's an implementation concern that should not be exposed in a domain layer, when using this in a clean architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants