Passing two parameter from angularjs to controller

Posted by Mareesnectar-12158 under ASP.NET Web API on 5/12/2015 | Points: 10 | Views : 747 | Status : [Member] | Replies : 0
Resource:
+ app.factory("EthnicCodeResource", ['$resource', function ($resource) {
+ return {
+ Codes: $resource('api/Code/:collection', { collection: '@collection' }, { postCollection: { method: 'POST', isArray: true } }),
+ Effects: $resource('api/Effects:reviewSetCode', { reviewSetCode: '@reviewSetCode' }, { setCode: { method: 'POST', isArray: true } }),
+ HCodes: $resource('api/HCodes')
+ }
+
+
+ Save:
+ EthnicCodeResource.Effects.setCode($rootScope.myData).$promise.then
(function() {

});
+
+ API Controller:
+ [HttpPost]
+ public void Post(List<EthnicCode> reviewSetCode)
+ {
+ //
+
+ }
+
+In my scenario I wanna pass two parameters (Array,string)to API controller POST method,
+like, [HttpPost]
+ public void Post(List<EthnicCode> reviewSetCode, string act)
+ {
+ //
+
+ }.
+

In my scenario I wanna pass two parameters (Array,string) to API controller POST method,
How can I determine resource and setCode for passing two parameter?




Responses

(No response found.)

Login to post response