Skip to content

C# .NET Core Web Api, A beginner friendly guide to learn N-Tier, SOLID principles, Interfaces, Repository Layer and Services. Consumer will get hands-on experience that how each layer work and communicate.

Notifications You must be signed in to change notification settings

usmankhan16677/SchoolManagementSystem

Repository files navigation

SchoolManagementSystem

SchoolManagementProject: 1.Set up N-Tier Architecture. ⦁ Seperate Layer for each project. e.g.

  1. SMS.Api (Entry Point, Controllers)
  2. SMS.Application (DTO's, Mappings, Services)
  3. SMS.Domian (Models, Interfaces)
  4. SMS.Infrastructure (Data, Migrations, Repositories) So we set each layers as:
  5. Persentation Layer: Handle user intraction (e.g. Web App or Wen Page)
  6. Service Layer: Contains Business Logic (e.g. Rules for processing Data)
  7. Repository Layer: Handles Data Access (e.g. Fetching Data from Db)
  8. Data Layer: Actual Db or Storage. KET CONCEPTS : ⦁ IRepository Interface : Define Methods the repository must impliment. (e.g. GetAllAsync, GetByIdAsync, CreateAsync, DeleteAsync, UpdateAsync It is like a contract) ⦁ Repository Class : This impliment the IRepository interface and contain actual code to intract with Database. SERVICE LAYER : It use Repository Layer to fetch to fetch or save data to apply rules and transformation to data. KEY CONCEPTS : ⦁ IService Interface : This define methods that Service must impliment (e.g. GetAllAdminAsync, GetAdminByIdAsync, etc) ⦁ Creating Service for each Entity : (e.g, AdminService, TeacherService, StudentService)

WORKFLOW : Http Request (Admin) ====> PRESENTATION LAYER ( Controller recieves req and calls AdminService ) ====> SERVICE LAYER (Service layer calls GetAllAsync on the IAdminRepository) ====> REPOSITORY LAYER (The AdminRepository fetches all admins record from Database and return to AdminService) ====> SERVICE LAYER AGAIN (AdminService transform the data (e.g. maps to )) and return to Controller ====> PERSENTATION LAYER AGAIN .

ARCHITECTURE USED:

  1. Repository Pattren.
  2. N-Tier Architecture.
  3. SOLID Priniciples
  4. Class Libraries.
  5. Seperation Of Concern.

About

C# .NET Core Web Api, A beginner friendly guide to learn N-Tier, SOLID principles, Interfaces, Repository Layer and Services. Consumer will get hands-on experience that how each layer work and communicate.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages