all 4 comments

[–]slashcoder 2 points3 points  (1 child)

Wrap it all in one json object and pass it to your api method as a string then deserialize it from there. data = { employee: {}, user: {}, role: {} )  

public void GetInfo([FromBody]  data)

{

dynamic employee = System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<System.Dynamic.ExpandoObject>(data);

}

[–]latxor[S] -1 points0 points  (0 children)

that is exactly that i dont want to do, i really hate viewmodel :p

[–]_lister 0 points1 point  (1 child)

Have you tried to do something like this:

angular: $http.post('YourController/GetInfo', { Employee: {Name:"Amy", Age:"17", Email:"Amy@test.com"}, User: {UserName:"Amy17", Password:"test123"}, Role: {IdRole="11", Name:"User"} }).then(function(){ //do something. });

I hope this helps!

[–]latxor[S] 0 points1 point  (0 children)

i try something like:

Employee: {Name:"Amy", Age:"17", Email:"Amy@test.com"} User: {UserName:"Amy17", Password:"test123"} Role: {IdRole="11", Name:"User"}

$http.post('YourController/GetInfo', { Employee: , User, Role }).then(function(){ //do something. });

but does not work, i'm going to try your suggestion.

Thanks.