標籤:blog http io 資料 2014 html 管理 new
接著上一篇(EF6.0+APS.NET MVC5.0項目初探一(介面展示),說說我搭建項目的一點心得。
第一步:我喜歡先建一個空的解決方案,只是個人喜好,不喜勿噴,呵呵。
第二步:添加項目所需要的類庫:
第三步:添加類庫引用
UI.Manage->BusinessLogic.BLL,Domain.Entity,Domain.ViewModel,Infrastructure.Common,UI.HtmlHelper
BusinessLogic.BLL->Domain.Entity,Infrastructure.Ioc,DataAccess.DAL
DataAccess.DAL->Domain.Entity,Domain.DbContext,系統程式集(System.Data.Entity,EntityFramework)
Domain.DbContext->Domain.Entity,System.ComponentModel.DataAnnotations
Infrastructure.Ioc->DataAccess.DAL
程式集說明:
UI.Manage 是後台管理的ASP.NET MVC5.0的網站項目。
UI.HtmlHelper 是一些擴充的htmlHelper。
BusinessLogic.BLL 是商務邏輯,UI.Manage 直接從這裡取資料。
DataAccess.DAL 是資料層。
DataAccess.IDAL 是資料介面層,暫時沒用上(現在還沒有面向介面)。
Domain.DbContext 是資料庫介面,裡面放著EF(code first 方式)訪問的網關。
Domain.Entity 實體驗證模型。
Domain.ViewModel 領域模型,用來對實體驗證模型進行轉換。
Infrastructure.Ioc IOC容器,DataAccess.DAL在這裡執行個體化,現在是直接new的DAL,以後會用Ninject注入。
Infrastructure.Common 公用輔助類庫。