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

Generate REST API from entity context #537

Open
Kaliumhexacyanoferrat opened this issue Oct 31, 2024 · 0 comments
Open

Generate REST API from entity context #537

Kaliumhexacyanoferrat opened this issue Oct 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

Kaliumhexacyanoferrat commented Oct 31, 2024

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
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added the enhancement New feature or request label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant