Skip to main content

2013 | Buch

ASP.NET MVC 4 and the Web API

Building a REST Service from Start to Finish

insite
SUCHEN

Über dieses Buch

This one hundred page book focuses exclusively on how you can best use the ASP.NET MVC 4 Framework to build world-class REST services using the Web API. It sets aside much of what the ASP.NET MVC Framework can do, and focuses exclusively on how the Web API can help you build web services. You will not find any help on CSS, HTML, JavaScript, or jQuery. Nor will you find any help on the Razor view engine, HTML Helpers, or model binding. If you need this information then Pro ASP.NET MVC 4 is your perfect book.

ASP.NET MVC 4 and the Web API: Building a REST Service from Start to Finish helps you build cutting-edge REST services using ASP.NET MVC 4 and the Web API in more depth and detail than any other resource. ASP.NET MVC has always been a good platform on which to implement REST, but with the advent of the Web API it has now become even better. This book will show you why it's great and how to get the most from it.

Author Jamie Kurtz will take you from zero to full-blown REST service hero in no time at all. And you'll even learn how to incorporate some popular open source tools along the way: little or no experience with ASP.NET or the MVC Framework is required.

Inhaltsverzeichnis

Frontmatter
CHAPTER 1. ASP.NET MVC as a Service Framework
Abstract
In the years since the first release of the .NET Framework, Microsoft has provided a variety of approaches for building service-oriented applications. Starting back in 2002 with the original release of .NET, a developer could fairly easily create an ASP.NET ASMX-based XML web service that allowed other .NET and non-.NET clients to call it. Those web services implemented various versions of SOAP, but were only available for use over HTTP.
Jamie Kurtz
CHAPTER 2. What is RESTful?
Abstract
This chapter explores what a service following the REST architecture should look like. Considering that such an API is, in theory, supposed to use the HTTP verbs and be focused on resources, its interface will be markedly different from your typical RPC-style API. So, as we design the service, we will compare the REST approach with a more traditional RPC or SOAP approach.
Jamie Kurtz
CHAPTER 3. Designing the Sample REST API
Abstract
Thus far you’ve learned some basic principles of the REST architecture using the HTTP protocol, and you’re now ready to start working on your task-management service. But first, you’ll need to take some time to carefully build up tables of resource types, their available HTTP actions, and associated URIs—similar to what you did in the last chapter with the account service example. Modeling these types will be the most important part of this exercise, similar in kind to the importance of patiently and intentionally modeling a database. It pays to think it through and get it right. And, as you walk through the different resource types, you’ll begin examining some code (yeah!).
Jamie Kurtz
CHAPTER 4. Building the Environment and Creating the Source Tree
Abstract
It’s time to start working in Visual Studio! You’ve spent the first three chapters learning about REST and the ASP.NET MVC Framework, as well as designing your task-management service and its underlying classes and database tables. More importantly, you’ve spent some time modeling the resource types and URLs you want to offer for your RESTful service.
Jamie Kurtz
CHAPTER 5. Controllers, Dependencies, and Managing the Database Unit of Work
Abstract
It’s now time to start dealing with some of the more complex concerns in the task-management service. In the previous chapter, you started with an empty folder, created a basic source-tree structure, added a new Visual Studio 2012 solution, and added the projects you know you’ll need for this little REST service. You also added some of the more basic code components, and setup the project and library references you anticipated needing. While each of these things is certainly important and critical to the overall design of the service, you’ve yet to address any of the following:
  • Controller activation
  • Dependencies
  • NHibernate configuration and mappings
  • Database unit of work management
  • Database transaction control
  • Security
  • Logging of service calls and exceptions
Jamie Kurtz
CHAPTER 6. Securing the Service
Abstract
Ah, security. You knew you’d get here eventually. Security is one of those areas in the architecture that can become wildly complex before you know it. People are counting on you to get it right—with no margin for error. Lawsuits happen and companies go under when security is implemented poorly. You simply can’t afford to mess it up!
Jamie Kurtz
CHAPTER 7. Putting It All Together
Abstract
It’s almost time to start writing the Web API-based controllers for the RESTful task-management service. You’ve spent the bulk of this book so far laying down important fundamentals. I’m a firm believer in really understanding how different pieces of an application work, as well as in knowing why you’ve made certain architectural decisions along the way. Essentially, you should be able to defend the choices you make for framework-level components, for the tools you use, for your application’s class structure, and for the way you write all the code. As such, it’s important to spend the necessary time to plan such fundamentals properly. At a minimum, you should be able to defend your own MVC 4 and Web API REST services.
Jamie Kurtz
Backmatter
Metadaten
Titel
ASP.NET MVC 4 and the Web API
verfasst von
Jamie Kurtz
Copyright-Jahr
2013
Verlag
Apress
Electronic ISBN
978-1-4302-4978-8
Print ISBN
978-1-4302-4977-1
DOI
https://doi.org/10.1007/978-1-4302-4978-8