Sorry all , my English isn't very well , so I will try to use code to tell everyone what I need.In format situations,I will create 2 controller when I have 2 models**(ex: users/product)** , as following
var serializer = new JavaScriptSerializer();
var users= new users() { id = 1};
var jsonText = serializer.Serialize(users);
var client = new HttpClient();
client.BaseAddress = new Uri("http://localhost:65370/");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
StringContent content = new StringContent(jsonText, Encoding.UTF8, "application/json");
///////////////
var a = client.PostAsync("api/users", users, new JsonMediaTypeFormatter()).Result; (client)
var b = client.PostAsync("api/product", product, new JsonMediaTypeFormatter()).Result; (client)
and then when the users and product controllers was created the post code should be like as following
public IHttpActionResult Postusers(users aa) {} (server)
public IHttpActionResult Postproduct(product bb) {} (server)
I just want to create 1 controller for above like as follwing
var b = client.PostAsync<users/product>("api/all", product, new JsonMediaTypeFormatter()).Result;(client)
public IHttpActionResult Post<T>(Object ForAll) where T : new() {} (server)
how can i building this structure,please help me to do this serious question, thanks