-
Notifications
You must be signed in to change notification settings - Fork 10k
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
User learning arc for new minimal/focused ASP.NET Core API experience #30580
Comments
👀 |
db.Todos.FindAsync(id) is Todo todo ? Ok(todo) : NotFound(); Might be an issue if after refactoring FindAsync starts returning non-Todo. May be |
I don't think that's a realistic concern? If you rename the type Todo, you'll likely rename the DbContext property |
Hello, I am trying on minimal API; could you please let me know that "how to apply a custom filter?". Currently, I implemented one HttpGlobalExceptionFilter and registered it in the controller, but it does not work
|
There are no filters in minimal APIs, you should be using middleware for something like HttpGlobalExceptionFilter |
Many thanks, do you have the document or article to share the limitation or features that will not be included in minimal APIs? |
It'll be the opposite. We'll have a list of what you CAN do 😄 |
Can you share its link? |
Once it exists, yes 😄 |
In the meantime there a few examples of the kinds of things you can do here. |
one word: "sexy"! |
Closing as some of the remaining items in this issue will be considered for .NET planning. See following issue: #36770 |
This code sample is intended to represent the coming together of the various efforts associated with "simplification" and "scaling-down" of C# HTTP API apps into a progressive narrative example of how one might learn or be taught the concepts with reasonably scaled steps during the grow-up journey.
This example uses a number of features (some existing, some committed, some proposed) including:
var (todo, isValid) = inputTodo; // Validated<Todo> inputTodo
return await db.Todos.FindAsync(id) is Todo todo ? Ok(todo) : NotFound();
dotnet run server.cs
)var myRoute = HttpGet("todo/{id}"); myRoute.Url(todo.Id);
builder.AddSqlite<EntityType>(string connectionString)
Not all concepts are necessarily required for an MVP (e.g. in an early preview) and we should capture details of how we think about that (TODO), e.g.
#!
support & global usings aren't required for this to be valuable but they naturally build on the MVP in a way that adds further value.We'll update this sample in-place as it evolves. In-progress iterations can be captured in gists and linked to in comments, etc.
The text was updated successfully, but these errors were encountered: