婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > ASP.NET MVC5網(wǎng)站開發(fā)文章管理架構(gòu)(七)

ASP.NET MVC5網(wǎng)站開發(fā)文章管理架構(gòu)(七)

熱門標簽:辦公用地圖標注網(wǎng)點怎么操作 上海市三維地圖標注 南昌自動外呼系統(tǒng)線路 海東防封電銷卡 寧德防封版電銷卡 西寧電銷外呼系統(tǒng)公司 聊城智能電銷機器人電話 云南外呼系統(tǒng)代理 安陸市地圖標注app

一、總體說明
先看一下文章管理設(shè)想要實現(xiàn)的功能:

再看一下類圖

這里Category是欄目;CommonModel是公共模型;Article是文章;Attachment是附件;

CommonModel是內(nèi)容管理這塊抽取出來的公共部分,像文章,咨詢甚至產(chǎn)品都有一些共同的內(nèi)容這里把它單獨提取出來作為一個類。CommonModel可能包含一片文章,包含一組附件,包含一系列評論,他們之間的關(guān)系類圖中已經(jīng)表示出來。

 二、搭建架構(gòu)
這個順序根以前一樣

1、IDAL
在IDAL添加接口InterfaceCommonModelRepository,其實只是繼承自InterfaceBaseRepository,沒有添加任何其他內(nèi)容。

namespace Ninesky.IDAL
{
 /// summary>
 /// 公共模型接口
 /// remarks>
 /// 創(chuàng)建:2014.02.23
 /// 修改:2014.02.28
 /// /remarks>
 /// /summary>
 public interface InterfaceCommonModelRepository:InterfaceBaseRepositoryModels.CommonModel> {

 }
}

再依次添加InterfaceCategory,InterfaceArticle,InterfaceAttachment,方式和公共模型接口相同。

2、DAL
DAL中是對IDAL接口的實現(xiàn),還是從CommonModel開始,先添加CommonModelRepository,也是跟原來一樣直接繼承沒有什么代碼。

namespace Ninesky.DAL
{
 /// summary>
 /// 公共模型倉儲
 /// remarks>
 /// 創(chuàng)建:2014.02.23
 /// /remarks>
 /// /summary>
 public class CommonModelRepository:BaseRepositoryModels.CommonModel>, IDAL.InterfaceCommonModel
 {
 }
}

然后依次添加CategoryRepository,ArticleRepository,AttachmentRepository。

3.IBLL

這次先從InterfaceCategoryService開始,InterfaceArticleService,InterfaceCommentService,InterfaceAttachmentService。InterfaceCommonModelService內(nèi)容較多放在最后。
InterfaceCategoryService

具體功能會在做欄目的時候再寫,這里暫時空著。

namespace Ninesky.IBLL
{
 /// summary>
 /// 欄目服務(wù)接口
 /// remarks>
 /// 創(chuàng)建:2014.02.23
 /// /remarks>
 /// /summary>
 public class InterfaceCategoryService:InterfaceBaseServiceModels.Category>
 {
 }
}

4.BLL

同樣先從CategoryService開始,然后依次添加ArticleService,AttachmentService。CommonModelService。

using Ninesky.DAL;
using Ninesky.IBLL;
using Ninesky.Models;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Ninesky.BLL
{
 /// summary>
 /// 欄目服務(wù)
 /// remarks>
 /// 創(chuàng)建:2014.02.27
 /// /remarks>
 /// /summary>
 public class CategoryService:BaseServiceCategory>,InterfaceCategoryService
 {
 public CategoryService() : base(RepositoryFactory.CategoryRepository) { }
 }
}

5、Web

在web項目的Member區(qū)域下添加三個空控制器。

欄目控制器CategoryController

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Ninesky.IBLL;
using Ninesky.BLL; 
using Ninesky.Models;

namespace Ninesky.Web.Areas.Member.Controllers
{
 [Authorize]
 public class CategoryController : Controller
 {
 private InterfaceCategoryService categoryRepository;
 public CategoryController() { categoryRepository = new CategoryService(); }
 

 }
}

文章控制器ArticleController

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Ninesky.Models;
using Ninesky.IBLL;
using Ninesky.BLL;

namespace Ninesky.Web.Areas.Member.Controllers
{
 public class ArticleController : Controller
 {
 private InterfaceArticleService articleService;
 private InterfaceCommonModelService commonModelService;
 public ArticleController() { articleService = new ArticleService(); commonModelService = new CommonModelService(); }
 }
}

附件控制器AttachmentController

using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Web;
using System.Web.Mvc;
using System.IO;
using Ninesky.IBLL;
using Ninesky.BLL;
using Ninesky.Models;

namespace Ninesky.Web.Areas.Member.Controllers
{
 /// summary>
 /// 附件控制器
 /// remarks>
 /// 創(chuàng)建:2014.03.05
 /// /remarks>
 /// /summary>
 [Authorize]
 public class AttachmentController : Controller
 {
 }
}

架構(gòu)結(jié)束啦,下面就開始實現(xiàn)文章相關(guān)功能!

您可能感興趣的文章:
  • ASP.NET MVC5網(wǎng)站開發(fā)管理列表、回復(fù)及刪除(十三)
  • ASP.NET MVC5網(wǎng)站開發(fā)我的咨詢列表及添加咨詢(十二)
  • ASP.NET MVC5網(wǎng)站開發(fā)修改及刪除文章(十)
  • ASP.NET MVC5網(wǎng)站開發(fā)添加文章(八)
  • ASP.NET MVC5網(wǎng)站開發(fā)用戶修改資料和密碼(六)
  • ASP.NET MVC5網(wǎng)站開發(fā)用戶登錄、注銷(五)
  • ASP.NET MVC5網(wǎng)站開發(fā)用戶注冊(四)
  • ASP.NET MVC5網(wǎng)站開發(fā)項目框架(二)
  • ASP.NET MVC5網(wǎng)站開發(fā)概述(一)
  • MVC4制作網(wǎng)站教程第三章 刪除用戶組操作3.4

標簽:洛陽 南寧 崇左 汕尾 贛州 青海 衢州

巨人網(wǎng)絡(luò)通訊聲明:本文標題《ASP.NET MVC5網(wǎng)站開發(fā)文章管理架構(gòu)(七)》,本文關(guān)鍵詞  ASP.NET,MVC5,網(wǎng)站開發(fā),文章,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《ASP.NET MVC5網(wǎng)站開發(fā)文章管理架構(gòu)(七)》相關(guān)的同類信息!
  • 本頁收集關(guān)于ASP.NET MVC5網(wǎng)站開發(fā)文章管理架構(gòu)(七)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 曲周县| 沙洋县| 甘洛县| 道孚县| 内乡县| 通许县| 霞浦县| 宜兴市| 南川市| 安国市| 富宁县| 淄博市| 芮城县| 安顺市| 利川市| 武强县| 万年县| 南京市| 大宁县| 若尔盖县| 蒲江县| 乐业县| 瑞丽市| 麟游县| 华阴市| 澎湖县| 栖霞市| 石楼县| 北川| 威宁| 吕梁市| 齐河县| 昌江| 陈巴尔虎旗| 平顺县| 班戈县| 武乡县| 出国| 屏南县| 房产| 保康县|