public object Bind(TypeSpec type = null, object patchedObject = null)
{
if (this.deserializedBody == null)
{
if (Request.Body == null)
throw new InvalidOperationException("No http body to deserialize.");
if (Method == HttpMethod.Patch)
{
patchedObject = patchedObject
?? Node.Session.Dispatch(new PomonaContext(Node, executeQueryable : true))
.Entity;
if (patchedObject != null)
type = TypeMapper.FromType(patchedObject.GetType());
}
this.deserializedBody = Deserialize(type as StructuredType, patchedObject);
}
return this.deserializedBody;
}