csharpfritz / InstantAPIs

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

IncludeTable/ExcludeTable - appropriate noun? #60

Open batesm opened 2 years ago

batesm commented 2 years ago

Using EntityFrameworkCore we can map an entity to multiple tables or multiple entities to a single table (TPT, TPH etc)

This made me wonder about the usage of nouns like “table” and “column” (when configuring IncludeTable/ExcludeTable). Perhaps a better and more consistent fit with EFCore domain language would be “entity” (or “entity type”) and “property”.

Hence IncludeEntity/ExcludeEntity instead…?

There is not always a one to one mapping regards entity to table.

csharpfritz commented 2 years ago

I'm not sold on this, as I think there are other storage shapes like Collection and Fields for other NoSQL storage types when we think of the repository pattern features.

batesm commented 2 years ago

I guess this means you’re planning to unify the “API config” classes? Currently there is one for DbContext and one for Json.

Anyway, I think the concept of Instant APIs is great and when it’s matured could be a very valuable tool to use 🙂

csharpfritz commented 2 years ago

Yes, the two configs should be merged and I think a future move towards a simple API that defines the storage mechanism as a Repository, EF Context, some other database provider, a JSON file, or some other format is a welcome change