开发者

Pass JSON objects to an action and map to List<object>?

I have an action method that takes in two different objects.

I am posting JSON to the action using jquery, to do this I put all the properties i want to map to my two objec开发者_如何学Pythonts in the one Json object. This works correctly and maps to the two objects in my action!

I want to be able to pass Json and map to a list of objects? is this possible in asp .net MVC?

Thanks

UPDATE: Looks like ActionFilters are the way to go here! found this post.


I think you should map to an object[] instead of a List<object>. This should map when adding an array of JSON objects as argument to your function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜