
Minimal APIs
Route handlers、parameter binding、filters、OpenAPI、route groups、パフォーマンス
18 面接問題·
Mid-Level
1ASP.NET Core における Minimal API とは何ですか?
1
ASP.NET Core における Minimal API とは何ですか?
回答
Minimal APIs は ASP.NET Core で HTTP API を作成するための簡素化されたアプローチで、.NET 6 で導入されました。controllers や複雑な設定を必要とせず、Program.cs に直接 endpoints を定義できます。このアプローチは boilerplate code を削減し、シンプルから中程度に複雑な API のパフォーマンスを向上させると同時に、よりモダンで関数型な開発体験を提供します。
2Minimal APIs で GET endpoint を定義できるメソッドはどれですか?
2
Minimal APIs で GET endpoint を定義できるメソッドはどれですか?
回答
MapGet は Minimal APIs で HTTP GET endpoint を登録するための専用メソッドです。route pattern と処理ロジックを定義する delegate をパラメータとして受け取ります。このメソッドは、他の HTTP verb 向けの MapPost、MapPut、MapDelete、MapPatch も含む Map* メソッドファミリの一部です。
3Minimal API endpoint で route parameter を binding するにはどうしますか?
3
Minimal API endpoint で route parameter を binding するにはどうしますか?
回答
Minimal APIs における route parameter の parameter binding は、命名規則によって自動的に行われます。route pattern 内に中括弧で囲んだパラメータを定義し、同じ名前のパラメータを handler のシグネチャに宣言するだけです。ASP.NET Core が自動的に binding と型変換を実行します。たとえば /users/{id} という pattern の場合、int id パラメータが自動的に binding され変換されます。
4
Minimal APIs における Results と TypedResults の違いは何ですか?
5
Minimal API の handler にサービスを注入するにはどうしますか?
+15 面接問題
その他の.NET面接トピック
C# の基礎
Junior
25問LINQ & Delegates
Junior
20問C#言語の基礎
Junior
15問ASP.NET Core の基礎
Junior
18問ASP.NET Core のリクエストライフサイクル
Junior
20問Configuration & Settings
Junior
20問アプリケーションのライフサイクル
Junior
20問Dependency Injection
Mid-Level
24問Entity Framework Core
Mid-Level
25問Web API開発
Mid-Level
22問ASP.NET Core における Async
Mid-Level
20問Authentication & Authorization
Mid-Level
18問HttpClient & ネットワーキング
Mid-Level
20問JSONシリアライズ
Mid-Level
20問Entity Framework Core 応用
Mid-Level
25問C# の高度な機能
Mid-Level
20問Clean Architecture
Mid-Level
20問Logging, Monitoring & Observability
Mid-Level
22問ユニットテストとxUnit
Mid-Level
20問統合テスト
Mid-Level
18問Docker & Containerization
Mid-Level
16問NuGet パッケージ管理
Mid-Level
16問Memory Management & GC
Senior
22問リアクティブプログラミング
Senior
24問Async/await とパターン
Senior
26問.NET デザインパターン
Senior
24問パフォーマンス最適化
Senior
22問セキュリティとベストプラクティス
Senior
24問SignalR とリアルタイム
Senior
22問マイクロサービスアーキテクチャ
Senior
25問