
Develop a production-ready enterprise payroll web app using ASP.NET Core, embracing lightweight, cross-platform, and cloud-ready design while applying multi-layered architecture and dependency injection for modular and loosely-coupled application.
Demo showcases a four-layer ASP.NET Core MVC enterprise app with employee and payroll modules, including authentication, pagination, validation, payslip generation, and Azure-backed data synchronization.
Learn to install essential development tools for the ASP.NET Core MVC project: SQL Server (Express or Developer), SQL Server Management Studio, Visual Studio Community, .NET Core SDK 2.2, and Git.
Explore the four-layer mvc web architecture, with presentation, services, persistence, and entity layers, using view models to guide the user experience and enforce authentication with role-based authorization.
Create an ASP.NET Core MVC web application named Paycompute in Visual Studio, configure individual user accounts, and build a multi-layer solution with presentation, entity, persistence, and services projects.
Add references to establish layer dependencies across presentation, services, persistence, and entity layers. The entity layer remains dependency-free.
Define an employee domain model with properties for id, employee number, first name, middle name, last name, full name, gender, and a payment records collection, using data annotations for validation.
Define the payment record domain model with a one-to-many employee relationship, including earnings and deductions, tax and NI details, and related tax year, while configuring foreign keys and money-type columns.
Defines enums for the entity layer: payment method (bank payments, cash, cheque), student loan (yes/no), and union membership (yes/no), and previews upcoming database context setup.
Copy the application DbContext to the persistence layer, configure EF Core and identity, define payment records, employees, and tax year DbSets, then update startup and run initial migration.
Initialize an empty git repository, add all files to the staging area, and make the initial commit; configure global user.name and user.email, then view history with git log.
Define the IEmployeeService interface to manage employee data, including create, retrieve by id, update, delete, and payroll checks for union fees and student loans, plus listing all employees.
Implement the employee service with a class in a folder wired to the application db context to create, get by id, update, delete, and list employees with async save changes.
Track the entire solution by moving all projects into a single folder, initializing git, staging files, and making an initial commit to include every project.
Learn how to scaffold an ASP.NET Core MVC employee controller, inject an employee service, and map domain models to an employee index view model for the index view.
Learn to build an employee create view model and implement robust data input validation with required fields, error messages, regex rules, and display names.
Create action method in the employee controller validates the posted view model, maps it to a new employee, and manages image upload and database update with antiforgery validation.
Implement the edit action in the EmployeeController by retrieving an employee by id, mapping to an edit view model, validating and updating the employee, and redirecting to the index.
Implement the detail action in the employee controller by creating an employee detail view model, mapping properties to display data, and returning the details view after retrieving employee by id.
Learn to implement the delete action in an asp.net core mvc app, including get and post handlers, view models, and redirect to index in the employee controller.
Register the employee service for dependency injection by adding scoped IEmployeeService and EmployeeService to the startup configure services method, enabling injection into the controller.
Modify the _Layout.cshtml in an ASP.NET Core MVC project to replace the header, apply a dark theme, and add a top nav bar, side menu, logo, and login partial view.
Build a dynamic sidebar layout in an ASP.NET Core MVC app, wiring employee and payroll menus with Font Awesome icons, collapsible sections, and proper routing to index actions.
Create the ASP.NET Core MVC employee index view to display a list of employees with photo, name, gender, city, and start date, with details, edit, and delete actions.
Create.cshtml - employee view demonstrates building a new employee form in an ASP.NET Core MVC app, with validation, enums, file upload, and navigation to index.
Create an edit view for an employee in an asp.net core mvc enterprise app, binding the employee model and making key fields read-only while allowing contact and job updates.
Create a detailed employee view in ASP.NET Core MVC by modeling employee data, displaying a photo with a circular avatar, a centered layout, stylized typography, and a payslip email workflow.
Create and test a delete view for employees in an ASP.NET Core MVC app, adding a delete confirmation message and a read-only full name field to confirm removal.
Design a pay computation service interface for payroll, enabling creation and retrieval of payment records, tax year data, and comprehensive payroll calculations including overtime, contractual earnings, deductions, and net pay.
Implement the pay computation service by creating PayComputationService that implements IPayComputation, uses DbContext to calculate net pay with contractual and overtime hours at 1.5x, plus tax, loan, and annual deductions.
Create a tax computation service by defining an interface with a single method to calculate monthly tax amounts, and implement it using UK 2019–2020 thresholds, personal allowance, and tiered rates.
Define National Insurance contribution interface and implement a service that calculates contributions using primary threshold, upper limit, 12 percent rate between thresholds, and 2 percent above the limit for 2019-2020.
Implement UK student loan repayment calculations by checking whether an employee pays the loan, applying threshold-based monthly amounts (15, 48, 60, 83 pounds) according to income bands.
Implement the union fees method by checking if an employee is a union member and returning 10 pounds when true, otherwise zero, using a conditional expression.
Building an Enterprise Application with ASP.NET Core MVC
For those with basic OOP knowledge & new ASP.NET Core , this course will use a project-based approach to teach ASP.NET Core full-stack web application development, Using the latest .net core SDK as of the time of production.
".NET Core is an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build device, cloud, and IoT applications." - Microsoft.
In this course, we will be developing a web-based, modular Enterprise Payroll Software using the popular ASP.NET Core Framework. We will use a multi-layered architecture and it will be hosted on Azure Cloud.
Project Technology Stack & Tools used
- C# Programming language
- .NET Core 2.2 & 3.0 SDK Covered
- MVC
- Entity Framework Core
- LINQ
- Visual Studio 2019
- Bootstrap 4
- SQL Server, Server Management Studio
- GIT Version Control System (VCS), Version 2.22.0
- RotativaCore (NuGet Library for PDF)
- Cmder (Console Emulator for Windows)
- Azure Cloud Portal