Pomona.PomonaContext.Bind C# (CSharp) Method

Bind() public method

public Bind ( TypeSpec type = null, object patchedObject = null ) : object
type TypeSpec
patchedObject object
return object
        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;
        }