Slides & Lab (PDF): https://bit.ly/niiemvc
C# basic
Class, Inheritance, Interface, Abstraction class
Async/Await
Extension method
Lambda Expression
HTML, CSS, JavaScript, jQuery, Bootstrap
SQL Server
Session 1 – Introduction to ASP.NET Core MVC
Theory
Overview of ASP.NET Core and web development stack.
MVC pattern: responsibilities of Model, View, Controller.
ASP.NET Core MVC project structure: Program, appsettings, Controllers, Views, wwwroot, Areas (brief mention).
Lab 01 – Getting Started
Create a new ASP.NET Core MVC project.
Explore project structure and run the app.
Create a controller with several actions and different return types (View, Content, Redirect, etc.).
Session 2 – Passing Data Between Controller and View
Theory
Model binding basics (route, query string, form values).
Passing data from controller to view: strongly typed model vs ViewBag vs ViewData vs TempData.
Simple forms: GET vs POST actions, form tag helpers.
Lab 02 – Data Flow Controller ↔ View
Create a model (e.g., Student or Product) and pass a single object and a list to views.
Use ViewBag/ViewData for simple messages or lists (e.g., dropdown options).
Implement a simple form that posts data back to controller and renders the result.
Upload file
Session 3 – Model Validation
Theory
Data Annotations: Required, StringLength, Range, EmailAddress, DataType, Display, etc.
ModelState and ModelState.IsValid in POST actions.
Displaying validation messages in views and enabling client-side validation.
Lab 03 – Validating Models
Add validation attributes to existing models.
Update Create/Edit actions to validate ModelState and handle invalid cases.
Display validation errors using asp-validation-for and validation summary.
Test invalid inputs on both client and server.
Session 4 – Razor Layout, Partial Views, View Components, Areas
Theory
Layout pages: _Layout.cshtml, RenderBody, sections.
Partial views for reusable fragments (forms, menus, cards).
View Components for reusable UI + logic (e.g., “Top N items”).
Areas for organizing large applications into modules (e.g., Admin, Customer).
Lab 04 – Reuse and Organize the UI
Create a shared layout with navigation and footer and apply it to all views.
Create partial views for common UI parts (menu, form section, header).
Implement at least one View Component that loads dynamic data and render it in the layout or a page.
Create an Admin area and move an admin controller and its views into this area.
Reflection day
Session 5 – Entity Framework Core: Introduction and Code First / Database First
Theory
EF Core overview: DbContext, DbSet, entities.
Code First vs Database First approaches: when to use each.
Connection strings in appsettings and configuration in Program.
Migrations (for Code First) basics.
Lab 05 – Working with EF Core
Code First:
Create entity classes and a DbContext.
Configure connection string and create database using migrations.
Database First:
Reverse engineer entity classes and DbContext from an existing database.
Connect a controller to the database and display a list of entities using EF Core.
Session 6 – EF Core: Filtering and Grouping
Theory
LINQ querying with EF Core: Where, OrderBy, ThenBy, Select.
GroupBy and aggregations (Count, Sum, Average, etc.).
Loading related data with Include and basic query optimization (AsNoTracking for read-only).
Lab 06 – Advanced EF Core Queries
Add filtering to list pages (search by keyword, filter by category/status).
Add sorting on one or more columns in an index view.
Implement a grouping query (e.g., count by category) and display grouped data in a view or View Component.
Session 7 – Authentication with ASP.NET Core Identity
Theory
Authentication concepts: identity, claims, cookie-based authentication.
ASP.NET Core Identity overview: user store, password hashing, sign-in/sign-out.
Identity-related middleware and configuration.
Lab 07 – Implementing Authentication
Add Identity to the project (or adapt the Individual Accounts template into the current app).
Create and update Identity tables in the database.
Implement user registration, login, and logout flows.
Protect some pages so that only authenticated users can access them (via [Authorize]).
Session 8 – Authorization (Roles & Policies)
Theory
Authorization vs authentication.
Role-based authorization with [Authorize(Roles = "Admin")].
Policy-based authorization (short introduction, optional).
Securing Admin area and sensitive actions.
Lab 08 (based on Lab 07 extension)
Create roles (Admin, User) and assign roles to selected users.
Restrict access to Admin area or management controllers to Admin role.
Use [Authorize] attributes at controller/action level and test different user roles.
Mid-term test
Session 9 – Web API Basics
Theory
Difference between MVC controllers and API controllers.
[ApiController] attribute, API routing, and automatic model validation.
Returning JSON and using HTTP status codes.
Lab 09 – Building Web APIs
Add an API controller for a main entity (e.g., ProductsApiController).
Implement endpoints: GET (list + detail), POST (create), PUT/PATCH (update), DELETE.
Use EF Core inside API controller for data access.
Test endpoints using Postman or browser.
Session 10 – Web API with AJAX and Front-End Integration
Theory
Consuming Web APIs from JavaScript (fetch API or jQuery AJAX).
Handling JSON responses, updating DOM dynamically.
Basic client-side error handling and UX considerations.
Lab 10
Build a page that loads data from the Web API using AJAX and renders it in a table or cards.
Implement a refresh feature without reloading the page.
Optionally implement create or delete via AJAX and update the UI dynamically.
Session 11 – Repository Pattern: Basic Repositories
Theory
Why use the Repository pattern (abstraction, testability, separation of concerns).
Designing entity-specific repositories (e.g., IProductRepository, IStudentRepository).
Injecting repositories via Dependency Injection instead of using DbContext directly in controllers.
Lab 11 – Applying Repository Pattern
Create repository interfaces and concrete EF Core-based implementations.
Register repositories in the DI container.
Refactor one or two controllers or services to use repositories.
Session 12 – Generic Repository & Unit of Work
Theory
Generic Repository: IRepository<T> and GenericRepository<T>.
Unit of Work pattern to coordinate multiple repositories and a single DbContext.
How Repository + Unit of Work integrate with DI and service layer.
Lab 12 – Generic Repository and UoW
Implement IRepository<T> interface and GenericRepository<T> with GetAll, GetById, Add, Update, Remove.
Implement IUnitOfWork exposing repositories (e.g., Products, Categories, Students).
Refactor services/controllers to depend on IUnitOfWork for multi-entity operations.
Session 13 – Performance and Caching
Theory
Performance considerations in ASP.NET Core MVC (DB calls, view rendering, Web API calls).
In-memory caching: when and what to cache.
Simple output or response caching (conceptual).
Lab 13 – Caching for Performance
Identify at least one expensive or frequently used query.
Implement in-memory caching for that query (e.g., category list, dashboard counts).
Compare behavior with and without caching (log execution time or DB hits).
Session 14 – State Management & Simple Real-Time Features
Theory
State management options: TempData, Session, Cookies.
When to use which approach (short-lived messages vs user session vs persistent preferences).
Introduction to SignalR for real-time features (notifications, live dashboards).
Lab 14 – Session & Notifications
Implement a simple cart or enrollment list feature using Session.
Use TempData to show status messages after redirects (e.g., “Create success”).
If time allows, create a small SignalR-based notification when a new record is added.
Session 15 – Logging and Error Handling
Theory
Logging with ILogger and configuration of logging providers.
Handling errors in development vs production: DeveloperExceptionPage vs UseExceptionHandler.
Custom error pages and error handling middleware.
Lab 15 – Adding Logging and Error Pages
Inject ILogger into at least one controller/service and add meaningful log messages.
Configure global exception handling and create custom error views.
Trigger some controlled errors to verify logs and error pages.
Session 16 – Testing
Theory
Unit testing basics with xUnit or NUnit.
Testing services that use repositories and Unit of Work.
Testing controllers using fake repositories or EF Core InMemory provider.
Lab 16 – Unit Tests for MVC Application
Create a test project and configure it.
Write unit tests for a service that uses IUnitOfWork and repositories.
Write at least one unit test for a controller action (e.g., Index or Create).
Session 17 – Capstone Project Integration
Theory (short)
Recap: MVC, EF Core, validation, layout, Identity, Web API, Repository, UoW, performance, logging, testing.
Project structure and best practices for a complete real-world MVC application.
Capstone Lab – Build the Complete App
Students work in groups to integrate all features into a single application:
MVC + EF Core + SQL Server.
Authentication and basic authorization.
Web API + AJAX.
Repository + Unit of Work.
Layout, partial views, View Components.
Basic caching, logging, and tests.
Session 18 – Deployment
Theory
Publishing ASP.NET Core applications (dotnet publish).
Deployment options: IIS on-premise, Azure App Service (overview).
Environment-specific configuration: appsettings.Development/Production.json, connection strings, environment variables.
Basic production hardening: HTTPS, connection string security, minimal logging in production.
Lab – Deploying the Capstone Application
Publish the capstone application to a folder.
Deploy to IIS on a lab or local server.
Configure production connection string and environment.
Run and verify the deployed app; groups present and demo their applications.
https://github.com/milanm/DotNet-Developer-Roadmap
Here are some of the important educational references to consider to deep dive and to prepare yourself for a technical interview:
ASP.NET Core Identity