.NET6_MVC開發三層式架構開發part1_搭配Autofac來實作IOC_專案功能模組架構前期準備

這邊我要來透過三層式架構創建專案 那基本上會拆分成 (1).UI顯示層 (2).業務邏輯層(BLL) (3).資料庫訪問層(DAL) 這裡會透過將三層都進行interface設計 透過IOC容器來去將interface與具體的實踐做串接 新建好空方案 並新建四個folder各自分別命名 準備好資料庫與相應表 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 use master; create database SchoolDb; use SchoolDb; create table Student ( [Id] [uniqueidentifier] primary key not null , [Name] [nvarchar]( 20 ) not null , [Age] [ int ] not null , [Sex] [ bit ] not null , --1:男生,0:女生 [Address] [nvarchar]( 500 ) not null , [CardId] [ varchar ]( 12 ) not null --身分證字號 ) use SchoolDb; create table Course ( [Id] [uniqueidentifier] primary key not null , [Name] [nvarchar]( 200 ) not null , --課程名稱 [Summary] [nvarchar] ( 500 ) null --課程描述 ) --成績屬於哪位學生修的哪門課 use SchoolDb; create table Score ( [Id] [uniqueidentifier] primary key not null , [Mark] [ numeric ]( 5 , 2 ) not null , --成績(分數) [CourseId] [uniqueidentifier] foreign key referenc...