I created restful wcf service which works great for get. Now iam building some post methods. The client posts me data to this service in JSON format. The service method will not have any parameters so i need to read the jsondata from the request made. I am unable to figure out how should i be able to retrieve the data made from the request.
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "/SaveEmployee", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
public bool SaveEmployee()
{
//Capture Employee Object Data here and perform save
return true;
}
[DataContract]
public class Employee
{
[DataMember]
public int Id
{
get;
set;
}
[DataMember]
public string Name
{
get;
set;
}
}