- Modern Web Development with ASP.NET Core 3
- Ricardo Peres
- 234字
- 2021-06-18 18:36:00
Controllers and Actions
This chapter talks about arguably the most important feature of MVC: where the logic is stored. This is where you implement the stuff that your application does, where a substantial part of your business logic is.
Controllers and actions are found by convention and are called as the result of routing rules, which were introduced in the previous chapter. But things can get very complex—there are many ways by which an action can retrieve data from the request; it can be asynchronous or synchronous and it can return many different kinds of data. This data can be cached so that essentially there is no performance penalty in repeating the request.
As we know, HTTP is stateless, but that does not really play well with modern applications like the ones we're interested in, so we need to maintain the state between requests. We would alsolike to return data, numbers, and text according to the culture and language of the person that is issuing the request. We will look at all of these topics in the course of this chapter.
In this chapter, we will learn about the following topics:
- How to use controllers
- How controllers are found
- What is the controller life cycle?
- What are controller actions?
- How to do error handling
- How to cache responses
- How to maintain the state between requests
- Using dependency injection
- Applying globalization and localization
- 多媒體CAI課件設計與制作導論(第二版)
- 程序員修煉之道:程序設計入門30講
- Design Principles for Process:driven Architectures Using Oracle BPM and SOA Suite 12c
- 構建移動網站與APP:HTML 5移動開發(fā)入門與實戰(zhàn)(跨平臺移動開發(fā)叢書)
- 少年輕松趣編程:用Scratch創(chuàng)作自己的小游戲
- Building Mapping Applications with QGIS
- Mastering Swift 2
- C語言程序設計
- Magento 1.8 Development Cookbook
- 深入RabbitMQ
- SQL Server數據庫管理與開發(fā)兵書
- Couchbase Essentials
- Getting Started with Python and Raspberry Pi
- Practical Microservices
- 遠方:兩位持續(xù)創(chuàng)業(yè)者的點滴思考