Is it possible to pass both a querystring along with a model object from angular to webapi? My first parameter is always filled however, the model parameter is null even though I see all the data in the Request Payload.
My model
public Class Person
{
public string Name {get; set;}
public DateTime date {get; set;}
}
My API method
[Route("MyRoute/")]
[HttpPost]
public DataSourceResult DataResult([ModelBinder(typeof(WebApiDataSourceRequestModelBinder))]DataSourceRequest request, Person model)
{
}
My querystring
http://localhost:60655/api/DataInput/DataResult/?page=1&pageSize=22
Request Payload
model: {name: "Time", date: "2014-12-18T18:35:52.087Z"…}
My Post call
const queryStr = `${toDataSourceRequestString(state)}`;
const ComplexObj = {
model: model,
};
const url = this._srvrUrl + apiRoute;
return this._http
.post(`${url}?${queryStr}`, ComplexObj)