官术网_书友最值得收藏!

Routes and model binding (Intermediate)

Starting from this recipe, we will slightly speed things up by leaving out details of Visual Studio usage, and in some cases only code snippets will be shown instead of full classes. It should be clear from the concepts where the snippets fit, and they can be further investigated in the code downloads for individual recipes.

For the sake of brevity, I will also show several tests in just one step and also the necessary production code in one go. Though, I strongly recommend that you stick to good TDD practices, and add the tests one at a time and make each one pass before moving on to the next.

In this recipe, we take a look at how to handle the other HTTP verbs apart from GET and how to work with dynamic routes such as /custumer/42, where 42 is the customer ID. We will also look at how to work with JSON data and how to do model binding.

In this recipe, we will see the Todo application, which is the running example of the book, take shape. In fact at the end of this recipe, you will have a backend—if hooked up correctly— that works with the canonical JavaScript library todo samples. The downloadable code for this recipe is attached with the backbone.js todo sample.

主站蜘蛛池模板: 锦屏县| 晋州市| 太康县| 巴青县| 简阳市| 九龙坡区| 渝中区| 宁德市| 河北区| 阳江市| 吐鲁番市| 霍邱县| 南召县| 得荣县| 垣曲县| 沂水县| 子洲县| 阜宁县| 浦县| 紫云| 门头沟区| 建湖县| 鹿邑县| 张家界市| 措美县| 六盘水市| 巴林左旗| 任丘市| 上犹县| 麻阳| 运城市| 五家渠市| 南溪县| 清丰县| 扎兰屯市| 三穗县| 法库县| 同仁县| 托克逊县| 温州市| 黄陵县|