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
Modules
Pipeline...
- Pipeline contributors
- Well-known contributors
- PipelineContinuation members
Resources
Handlers
Binding...
- Object binders
- The default resource binder?
- ChangeSet<T> support?
Codecs...
- The Webforms Codec
- The XmlSerializer codec
- The JsonDataContract codec
- The XmlDataContract codec
Building Codecs...
- Building a media type reader
- Building a media type writer
- MediaType attribute
- Implementing configuration for ICodec
- Supporting binders and ChangeSet<> in a codec?
Using the JsonDataContractCodec
The JsonDataContractCodec provides JSON representations of resources.
Registering the codec
Whenever you want to render a resource using the JsonDataContractCodec, use the following form:
ResourceSpace.Has.ResourcesOfType<Customer>() /* your handler declaration */ .AsJsonDataContract();
This is a shorthand version of the full codec registration:
ResourceSpace.Has.ResourcesOfType<Customer>() /* your handler declaration */ .TranscodedBy<JsonDataContractCodec>(null)
Serialization Considerations
While it is not necessary to decorate the resource with System.Runtime.Serialization attributes such as DataContract and DataMember, doing so allows for much more control over the final rendered output.
