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?
Implementing Configuration for an ICodec
Codecs (objects which implement IMediaTypeReader or IMediaTypeWriter, which both descend from ICodec) require that you implement the ICodec interface:
object Configuration { get; set; }
This configuration object corresponds directly to the single parameter taken by the TranscodedBy<TCodec>(object configuration) method when configuring using Fluent Configuration. For example,
ResourceSpace.Has.ResourcesOfType<Customer>() .AtUri("/customer/{id}") .HandledBy<CustomerHandler>() // This anonymous object is used by the WebFormsCodec to decide which view to use .TranscodedBy<WebFormsCodec>(new { index = "~/Views/Customer.aspx" });
NB: Many codecs don't require a configuration, so this implementation will often do nothing.
See also
- Available Tutorials - Implementing a codec
