Assignment 4
Assignment 4
it work?
routing?
definitions?
parameters?
constraints?
in routing?
.NET Core?
Core?
.NET Core?
does it work?
16. How can you create custom middleware in
.NET Core?
“Minimal API”
application?
location?
24. How do you restrict access to specific static
files?
wwwroot or cloud?
Middleware Tasks:
Routing Tasks
1. Project Setup:
2. Course Model:
Sample Data:
Course 1:
o CourseId = 101
o CourseName = "C# for Beginners"
o CourseFee = 250
o CourseDuration = "8 weeks"
Course 2:
o CourseId = 102
o CourseName = "ASP.NET Core Fundamentals"
o CourseFee = 300
o CourseDuration = "10 weeks"
Course 3:
o CourseId = 103
o CourseName = "Entity Framework Core"
o CourseFee = 200
o CourseDuration = "6 weeks"
Endpoints:
1- URL: /
Method: GET
Response: Welcome to the Best Courses
URL: /course-fee/{courseId}
Method: GET
Query Parameter: ?discount=10 (optional, must
be between 0-100).
Behavior: If provided, applies a discount to the
course fee.
HTTP Status Codes: