1
Answer

Help How to Send Variables, read comments

public HttpResponseMessage Post(ws_verific_codes vcode)
{
Random rnd = new Random();
int msg = rnd.Next(1000, 10001);
string stat = 'sind';
try
{
//vcode is sent from another app
//i want to send msg and stat together with vcode
//How can i do that inside the code below
//In summary: I want to send "vcode, msg, stat"
Db.ws_verific_codes.Add(vcode);
//Instead of that above, how can I do as below:
Db.ws_verific_codes.Add(vcode, msg, stat);
Db.SaveChanges();
var response = Request.CreateResponse(HttpStatusCode.Created);
response.Headers.Location = new Uri(Request.RequestUri.ToString());
return response;
}
catch (Exception ex)
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex);
}
}
Answers (1)