TracNav
OpenRasta's Documentation...
- Release Notes
- FAQs
Downloading/Building OpenRasta...
- Download from source
- Download the binaries
- Run the test suite
- .NET versions support
Using OpenRasta...
- Configuration how-tos
What you need to know about dependency injection
Tutorials
Building web-sites with OpenRasta...
- Supporting clients that only know GET and POST
Reference...
Hosting
Configuration...
- ResourceSpace.Has
- ResourceSpace.Uses
Modules
Pipeline...
- Pipeline contributors
- Well-known contributors
- PipelineContinuation members
Resources
Handlers
Binding...
- Object binders
- The default resource binder?
- ChangeSet<T> support?
Codecs
ResourceSpace.Has
Use ResourceSpace.Has to define what your web application will serve in terms of resources. ResourceSpace.Has is merely a stem from which a variety of fluent configuration expressions can flow. It is therefore difficult to document in reference form such that it resembles a real configuration - you may prefer to learn about it from the configuration How-Tos.
.ResourcesOfType<TResource>()
This is the primary means of configuring OpenRasta. More than one .ResourcesOfType<TResource> can exist for the same type, but OpenRasta will attempt to combine the two definitions. It is therefore not possible to have ResourcesOfType<TResource> twice with the same type and the same handler as defined later by .HandledBy<THandler>().
Example
ResourceSpace.Has.ResourcesOfType<Customer>()
.AtUri(string)
This definition follows ResourceSpace.Has.ResourcesOfType<TResource>() and is used to tell OpenRasta what URI a particular resource will be served from. The string parameter takes a URI template, which is a URI which has zero or more replaceable parts signified by curly braces, for example /customers/{id}. Multiple URIs may be registered using a repeatable definition using .And.
.And - repeatable definitions
.And may be used following .AtUri(string) to indicate that there is more than one URI associated with this resource type. It may also be used following .HandledBy<THandler>() to specify multiple handlers (not common) and after TranscodedBy<TCodec>(object) or any of its sub-definitions to indicate multiple transcodings (very common) for a resource.
.HandledBy<THandler>()
This definition follows .AtUri(string) and is used to tell OpenRasta that there is a handler whose concrete type is THandler which has on it methods which OpenRasta may use to serve representations of resources.
TranscodedBy<TCodec>(object)
This definition follows a .HandledBy<THandler>() definition and is used to tell OpenRasta what objects will transcode the resources into their wire representations. The object parameter is a configuration object whose use differs depending on the codec. Some codecs, such as the JsonDataContractCodec require this but do not use it. It's acceptable to pass null in many circumstances, but check the documentation for the codec you are using.
