I created the Insert method to insert the data in Mysql using entity when testing with fiddler
I solution of this url but not wroking to me Fiddler testing API Post passing a [Frombody] class
User-Agent: Fiddler
Host: localhost:4086
Content-Length: 193
Content-type: application/json; charset=utf-8
Above format showing null for collection object
public class InsertController : BaseApiController
{
static readonly IInsertMaster obj = new InsertMaster();
[HttpPost]
public HttpResponseMessage PostUser(collection_master collection)
{
if (collection == null)
return Request.CreateResponse(HttpStatusCode.BadRequest, "not created");
if (obj.PostUser(collection))
{
return Request.CreateResponse(HttpStatusCode.Created, TheModelFactory.create(collection));
}
else
return Request.CreateResponse(HttpStatusCode.BadRequest, "Could not save to the database");
}
}
Input:
{"CustomerID":"10","AmountRecevied":1000","Date_Time":"2014-03-03 10:00:00","Area":"banglore","AgentID":"1","Money_Receipt_No":"123456","Payment_Mode":"cheque","Money_Receipt_Photo":null}