Testing sample REST service using Web API and Azure

I did the example at http://www.windowsazure.com/en-us/develop/net/tutorials/rest-service-using-web-api/

As I was discussing with Anders and Alejandro in a previous post, there is another alternative to access data models and that is using Web API and script blocks. I think this sample helps to clarify in how to do that.

The key parts concerning use of Web API, I believe, for this sample are:

public string Self
                return string.Format(CultureInfo.CurrentCulture,
                    "api/contacts/{0}", this.ContactId);
            set { }

At the Contact class definition.

Notice the use of the property Self at the script block at the Index view for Home controller. Notice how Self property is used to connect with the methods at the API type controller Contacts.

You can see the site at http://contactmgr23.azurewebsites.net/. You can also try adding /api/contacts to the URL and see what happens, it will be shown differently at Firefox and Chrome than as in IE.

Note:Julio Avellaneda has a serie of posts in Spanish on Web API. http://julitogtu.com/category/asp-net-web-api/ Julio participates too at FB group Desarrolladores Nicaragua.