【发布时间】:2015-10-29 04:08:42
【问题描述】:
我的 edm 中有一个无类型模型,定义如下:
<EntityType Name="Content">
<Key>
<PropertyRef Name="Id"/>
</Key>
<Property Name="Id" Type="Edm.Guid"/>
<Property Name="Title" Type="Edm.String"/>
</EntityType>
当我尝试从 html 表单提交请求时,我的 POST 操作中的 IEdmEntityObject 为空。
public HttpResponseMessage Post(IEdmEntityObject entity)
这适用于 json - 实体填充了属性,但 odata 反序列化器似乎不理解 application/x-www-form-urlencoded mime-type
<form method="POST" action="http://localhost/api/odata/content">
Title:<br>
<input type="text" name="Title" value="Mouse">
<br>
<input type="submit" value="Submit">
</form>
【问题讨论】:
标签: c# json asp.net-web-api odata