csharpfritz / InstantAPIs

A library that generates Minimal API endpoints for an Entity Framework context.
MIT License
448 stars 58 forks source link

Need to have ability to exclude specific entities or properties #2

Closed kraghavk closed 2 years ago

kraghavk commented 2 years ago

I love the idea behind this project. This is great and I am looking forward to this becoming more mature, stable and famous!

The following configuration options might be required in a lot of cases:

  1. Exclude specific entities: I might be fine with exposing a 100 other entities within my DbContext in this way. But I need the ability to exclude some (for example User entity), so that I can create my own endpoints with my own business logic for it.
  2. Exclude specific properties of an entity: In some cases, there may be properties that are not meant to be modified directly by a PUT or a POST request. For example, columns that are updated behind the scenes via some business logic.

Thanks, Raghu

verbedr commented 2 years ago

Suggestion for the properties. In true DDD fashion, they need to be read-only (private setter). Could this work? It would drop the need for complex configuration of includes/excludes.

kraghavk commented 2 years ago

That would absolutely work and eliminate messy configuration.

On Sat, 19 Feb, 2022, 3:14 pm Dries, @.***> wrote:

Suggestion for the properties. In true DDD fashion, they need to be read-only (private setter). Could this work? It would drop the need for complex configuration of includes/excludes.

— Reply to this email directly, view it on GitHub https://github.com/csharpfritz/InstantAPIs/issues/2#issuecomment-1045979043, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJEA5X2BCBM4GOP6EAGPU3U35Q73ANCNFSM5OVD4MJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>