Open
Description
As a developer of a web application, I would like to expose an existing entity context as an API so that I do not have to write typical boiler code and can spin up a new API even faster.
Example
public class MyContext : DbContext
{
public DbSet<MyType> MyTypes { get; set; }
}
var app = Entities.From<MyContext>()
.AddOpenApi();
Host.Create()
.Handler(app)
.Run();
Acceptance criteria
- The feature is implemented in a new module (or even GitHub repository)
DbContext
instances can either be created using a parameterless constructor or via a factory method- Entities are automatically exposed via REST
- Entities can be filtered, paged etc.
- The logic reuses the
MethodCollection
capabilities for the sake of simplicity - The feature is compatible with the Open API module (meaning that its content can be discovered)
- Authorization can be applied on entity/method level (probably another issue as this is also relevant for all of the other frameworks)
- The feature is documented as a framework on the GenHTTP website
- There is a project template for this kind of project
- The feature is covered by acceptance tests