发布方法:
[HttpPost]
public Dictionary<string, object> PostData(ODataActionParameters param)
{
}
构建EDM模型:
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
var customSave = builder.EntityType<Model>().Collection.Action("PostData");
如何设置动作“customSave”的返回?
答案 0 :(得分:0)
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
var customSave = builder.EntityType<Model>().Collection.Action("PostData");
customSave.ReturnsCollection<Dictionary<string, object>>();
建立返回类型是Primitive或ComplexTypes集合时使用的Action的返回类型。