没有合适的资源?快使用搜索试试~ 我知道了~
首页2016版ASP.NET Core MVC开发实战指南
"《Pro ASP.NET Core MVC (2016)》是一本面向专业开发者的教程,由Adam Freeman撰写,专门介绍在2016年发布的ASP.NET Core 1.0框架下的MVC(Model-View-Controller)开发技术。该书是ASP.NET Core系列的第六版,虽然它发布于早期版本,但与后来的Core 2.0框架在核心概念上差异不大,适合那些希望紧跟技术潮流并学习最新技术的开发者。 本书详细讲解了如何构建云准备就绪的Web应用程序,使用Microsoft最新的.NET Core框架。作者Adam Freeman以其深入浅出的方式,带领读者探索MVC架构的设计原则和实践技巧,包括但不限于控制器、视图和模型之间的交互,路由配置,以及与数据库的集成。书中提供了丰富的代码示例和实战项目,帮助读者快速理解和掌握ASP.NET Core MVC的开发流程。 值得注意的是,该书提供了高清版的目录,并附有英文原版PDF,方便读者阅读和复制学习内容。此外,它还包含了版权信息,声明所有权利归Adam Freeman所有,强调了对原著的尊重和法律保护。书中可能会引用和展示商标名称、标志和图像,但这些使用仅限于编辑目的,以体现商标所有者的权益。 作为一本专业教材,《Pro ASP.NET Core MVC (2016)》不仅适合初学者通过实践项目来入门.NET Core MVC开发,也适合有一定经验的开发者进行技术提升和系统学习。尽管技术在不断演进,但该书的基础知识和设计原则依然具有较高的参考价值。对于那些希望在当时最新技术框架下提升Web开发技能的读者来说,这本书是一份宝贵的资源。"
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/10106942/bg10.jpg)
■ CONTENTS
xvi
■Chapter 15: URL Routing.................................................................................... 425
Preparing the Example Project ..................................................................................... 427
Creating the Model Class ....................................................................................................................428
Creating the Example Controllers .......................................................................................................429
Creating the View ...............................................................................................................................430
Introducing URL Patterns ............................................................................................. 431
Creating and Registering a Simple Route .................................................................... 433
Defi ning Default Values ................................................................................................ 434
Defi ning Inline Default Values .............................................................................................................435
Using Static URL Segments .......................................................................................... 437
Defi ning Custom Segment Variables ............................................................................ 442
Using Custom Variables as Action Method Parameters ......................................................................444
Defi ning Optional URL Segments ........................................................................................................446
Defi ning Variable-Length Routes ........................................................................................................448
Constraining Routes ..................................................................................................... 451
Constraining a Route Using a Regular Expression .............................................................................. 454
Using Type and Value Constraints .......................................................................................................455
Combining Constraints .......................................................................................................................456
Defi ning a Custom Constraint .............................................................................................................457
Using Attribute Routing ................................................................................................ 460
Preparing for Attribute Routing ...........................................................................................................460
Applying Attribute Routing ..................................................................................................................461
Applying Route Constraints ................................................................................................................464
Summary ...................................................................................................................... 464
■Chapter 16: Advanced Routing Features ........................................................... 465
Preparing the Example Project ..................................................................................... 466
Generating Outgoing URLs in Views ............................................................................. 468
Generating Outgoing Links .................................................................................................................468
Generating URLs (and Not Links) ........................................................................................................479
![](https://csdnimg.cn/release/download_crawler_static/10106942/bg11.jpg)
■ CONTENTS
xvii
Customizing the Routing System ................................................................................. 480
Changing the Routing System Confi guration ......................................................................................481
Creating a Custom Route Class ..........................................................................................................482
Working with Areas ...................................................................................................... 493
Creating an Area .................................................................................................................................493
Creating an Area Route .......................................................................................................................494
Populating an Area .............................................................................................................................495
Generating Links to Actions in Areas ..................................................................................................497
URL Schema Best Practices ......................................................................................... 499
Make Your URLs Clean and Human-Friendly ......................................................................................499
GET and POST: Pick the Right One ......................................................................................................500
Summary ...................................................................................................................... 501
■Chapter 17: Controllers and Actions .................................................................. 503
Preparing the Example Project ..................................................................................... 504
Preparing the Views ............................................................................................................................506
Understanding Controllers ............................................................................................ 508
Creating Controllers ..................................................................................................... 508
Creating POCO Controllers ..................................................................................................................508
Using the Controller Base Class .........................................................................................................511
Receiving Context Data ................................................................................................ 512
Getting Data from Context Objects .....................................................................................................512
Using Action Method Parameters .......................................................................................................517
Producing a Response .................................................................................................. 519
Producing a Response Using the Context Object ................................................................................519
Understanding Action Results .............................................................................................................520
Producing an HTML Response ............................................................................................................522
Performing Redirections .....................................................................................................................531
Returning Different Types of Content ..................................................................................................538
![](https://csdnimg.cn/release/download_crawler_static/10106942/bg12.jpg)
■ CONTENTS
xviii
Responding with the Contents of Files ...............................................................................................540
Returning Errors and HTTP Codes ......................................................................................................542
Understanding the Other Action Result Classes .................................................................................544
Summary ...................................................................................................................... 545
■Chapter 18: Dependency Injection ..................................................................... 547
Preparing the Example Project ..................................................................................... 548
Creating the Model and Repository ....................................................................................................549
Creating the Controller and View ........................................................................................................551
Creating the Unit Test Project .............................................................................................................553
Creating Loosely Coupled Components ........................................................................ 554
Examining Closely Coupled Components............................................................................................554
Introducing ASP.NET Dependency Injection .................................................................. 561
Preparing for Dependency Injection ...................................................................................................561
Confi guring the Service Provider ........................................................................................................562
Unit Testing a Controller with a Dependency ......................................................................................564
Using Dependency Chains ..................................................................................................................565
Using Dependency Injection for Concrete Types .................................................................................568
Understanding Service Life Cycles ............................................................................... 570
Using the Transient Life Cycle.............................................................................................................570
Using the Scoped Life Cycle ...............................................................................................................574
Using the Singleton Life Cycle ............................................................................................................576
Using Action Injection ................................................................................................... 577
Using the Property Injection Attributes ......................................................................... 577
Manually Requesting an Implementation Object .......................................................... 578
Summary ...................................................................................................................... 579
![](https://csdnimg.cn/release/download_crawler_static/10106942/bg13.jpg)
■ CONTENTS
xix
■Chapter 19: Filters ............................................................................................. 581
Preparing the Example Project ..................................................................................... 582
Enabling SSL .......................................................................................................................................583
Creating the Controller and View ........................................................................................................584
Using Filters ................................................................................................................. 586
Understanding Filters ................................................................................................... 589
Getting Context Data ...........................................................................................................................589
Using Authorization Filters ........................................................................................... 590
Creating an Authorization Filter ..........................................................................................................591
Using Action Filters ...................................................................................................... 593
Creating an Action Filter .....................................................................................................................595
Creating an Asynchronous Action Filter ..............................................................................................597
Using Result Filters ...................................................................................................... 598
Creating a Result Filter .......................................................................................................................599
Creating an Asynchronous Result Filter ..............................................................................................600
Creating a Hybrid Action/Result Filter .................................................................................................602
Using Exception Filters ................................................................................................. 604
Creating an Exception Filter ...............................................................................................................605
Using Dependency Injection for Filters ......................................................................... 607
Resolving Filter Dependencies ...........................................................................................................607
Managing Filter Life Cycles ................................................................................................................611
Creating Global Filters .................................................................................................. 614
Understanding and Changing Filter Order .................................................................... 617
Changing Filter Order .........................................................................................................................619
Summary ...................................................................................................................... 620
■Chapter 20: API Controllers ............................................................................... 621
Preparing the Example Project ..................................................................................... 622
Creating the Model and Repository ....................................................................................................622
Creating the Controller and Views ......................................................................................................624
Confi guring the Application ................................................................................................................626
![](https://csdnimg.cn/release/download_crawler_static/10106942/bg14.jpg)
■ CONTENTS
xx
Understanding the Role of RESTful Controllers ............................................................ 628
Understanding the Speed Problem .....................................................................................................629
Understanding the Effi ciency Problem ...............................................................................................629
Understanding the Openness Problem ...............................................................................................630
Introducing REST and API Controllers .......................................................................... 630
Creating an API Controller ...................................................................................................................631
Testing an API Controller .....................................................................................................................635
Using the API Controller in the Browser ..............................................................................................639
Understanding Content Formatting .............................................................................. 641
Understanding the Default Content Policy ..........................................................................................642
Understanding Content Negotiation ....................................................................................................643
Specifying an Action Data Format ......................................................................................................646
Getting the Data Format from the Route or Query String ...................................................................647
Enabling Full Content Negotiation ......................................................................................................648
Receiving Different Data Formats .......................................................................................................650
Summary ...................................................................................................................... 651
■Chapter 21: Views ............................................................................................. 653
Preparing the Example Project ..................................................................................... 654
Creating a Custom View Engine ................................................................................... 656
Creating a Custom IView ....................................................................................................................657
Creating an IViewEngine Implementation ...........................................................................................658
Registering a Custom View Engine .....................................................................................................659
Testing the View Engine ......................................................................................................................660
Working with the Razor Engine .................................................................................... 663
Preparing the Example Project ...........................................................................................................663
Demystifying Razor Views ..................................................................................................................665
Adding Dynamic Content to a Razor View .................................................................... 669
Using Layout Sections ........................................................................................................................669
Using Partial Views .............................................................................................................................675
Adding JSON Content to Views ...........................................................................................................678
剩余1030页未读,继续阅读
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/default.jpg!1)
gamedkp
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- AirKiss技术详解:无线传递信息与智能家居连接
- Hibernate主键生成策略详解
- 操作系统实验:位示图法管理磁盘空闲空间
- JSON详解:数据交换的主流格式
- Win7安装Ubuntu双系统详细指南
- FPGA内部结构与工作原理探索
- 信用评分模型解析:WOE、IV与ROC
- 使用LVS+Keepalived构建高可用负载均衡集群
- 微信小程序驱动餐饮与服装业创新转型:便捷管理与低成本优势
- 机器学习入门指南:从基础到进阶
- 解决Win7 IIS配置错误500.22与0x80070032
- SQL-DFS:优化HDFS小文件存储的解决方案
- Hadoop、Hbase、Spark环境部署与主机配置详解
- Kisso:加密会话Cookie实现的单点登录SSO
- OpenCV读取与拼接多幅图像教程
- QT实战:轻松生成与解析JSON数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)