• ASP.NET MVC 简易在线书店


     写这篇博客的目的是为了记录自己的思想,有时候做项目做着做着就不知道下面该做什么了,把项目的具体流程记录下来,培养好习惯。

     创建MVC项目

     

     创建控制器StoreController

    public class StoreController : Controller
    {
    }

    添加书籍类别动作Index

    public ActionResult Index()
    {
           return View();
    }

    根据书籍类别编号显示书籍Browse

    public ActionResult Browse(int id)
    {
          //根据类别id获取书籍
          return View(_categoryRepository.GetCategoriesById(id));
    }

    根据书籍Id获取书籍详细信息Details

    public ActionResult Details(int id)
    {
         //根据书籍id获取详细书籍信息
         return View(_categoryRepository.GetBooksById(id));
    }

    创建实体数据模型

  • 相关阅读:
    【题解】【HAOI2011】Problem b
    【题解】完全平方数
    sqoop安装
    hive安装
    hbase分布式安装
    zookeeper分布式安装
    hadoop分布式安装
    zabbix proxy安装及使用
    web数据存储
    js格式
  • 原文地址:https://www.cnblogs.com/772933011qq/p/4461285.html
Copyright © 2020-2023  润新知