- Modern Web Development with ASP.NET Core 3
- Ricardo Peres
- 302字
- 2021-06-18 18:36:02
Summary
In this chapter, we saw that using POCO controllers is not really needed, and it requires more work than whatever benefit we can take out of it, so we should have our controllers inherit from Controller.
Then we saw that using asynchronous actions is good for improved scalability as it won't affect performance much, but your app will be more responsive.
You can forget about XML formatting, as JSON works perfectly, and is the standard way to send and process data on the web.
We learned that we should use POCO classes as the model for our actions. The built-in model binders work well, as we'll see in upcoming chapters, but you can add the cookie value provider as it may come in handy.
As far as model validation is concerned, we saw that it is better to stick to the good old data annotations API. If necessary, you should implement IValidatableObject in your model.
The Redis distributed cache system is very popular and is supported by both Azure and AWS. Redis should be your choice for a distributed cache to keep reference data; in other words, stuff that isn't changed often.
Performance-wise, response caching is also useful. The products page shouldn't change that much, so at least we can keep it in the cache for a few hours.
This was a long chapter where we covered controllers and actions, arguably the most important aspects of ASP.NET Core. We also covered parts of the model concept, such as binding, injection, and validation. We saw how we can maintain the state and the possible values that we can return from an action. We also learned how to use resources for translation purposes. Some of these concepts will be revisited in future chapters; in the next one, we will be talking about views.
- Learning Scala Programming
- Clojure Programming Cookbook
- TypeScript入門與實戰
- Learning Apex Programming
- Learning Docker
- OpenCV for Secret Agents
- C語言程序設計
- C++新經典
- Visual Basic程序設計
- Python High Performance Programming
- C++從入門到精通(第5版)
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- 從零開始學UI:概念解析、實戰提高、突破規則
- SAP Web Dynpro for ABAP開發技術詳解:基礎應用
- 零基礎學Java第2版