Change to RestClassAttribute and RestMethodAttribute

written by Ryan Olshan on Monday, September 22 2008

Shortly after posting Handling POST and PUT methods with Lullaby, I started thinking about how the implementation dictating that the type the request stream is deserialized to is the REST methods enclosing type should be changed to have the option to be configured by the user. I made a change to RestClassAttribute and RestMethodAttribute that allows for this.

  • RestMethodAttribute.DeserializeRequestStream (System.Boolean) - This property allows the user to specify that the request stream should be deserialized. This is set to true by default for POST and PUT method requests.
  • RestMethodAttribute.DeserializationType (System.Type) - This property sets the type to deserialize the request stream to. If a value is not set for this property, then the request stream will be deserialized as the enclosed type of the REST method. Setting this property on the RestClassAttribute attribute will override the type to deserialize to for all REST methods in the REST class.
Kick this post on .NET Kicks

Similar Posts

  1. Handling POST and PUT methods with Lullaby
  2. Introducing Lullaby
  3. Lullaby's authentication provider framework

Post a comment