Some notes before we start
WebApi is not directly razor, as it's not meant to actualy render HTML. It's coded using C# just like razor,
but won't have commands like
Basic WebApi Examples
WebApi - Very basic examples
Creating the simplest possible hello WebApi and a Square(number) Api.
WebApi - Basic example with CSRF protection
This is almost the same as the simplest WebApi, but with additional Cross-Site-Request protection.
WebApi using Polymorph (multiple editions of same API)
WebApi Polymorph - basic examples
Basic example showing the same API in a live and staging editior, so you can develop while the users still use the sable one.
WebApi to access real App Data
WebApi App.Data - basic examples
Basic example reading App Data.
WebApi App.Query - basic examples
Basic example reading App Query.
More Information around WebApi
C# Web API in the 2sxc Wiki