Send JSON date to WCF service
- by user1394569
I want to post json object to my WCF service
My only problem is his date property. I get the date from an jquery datepicker and i want to get it in my service as c# datetime.
My service:
namespace Employee
{
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebInvoke(Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped)]
bool UpdateEmployee(Employee Employee);
}
}
And this is Employee:
[DataContract]
public class Employee
{
[DataMember]
public string Name { get; set; }
[DataMember]
public string Department { get; set; }
[DataMember]
public int Salary { get; set; }
[DataMember]
public DateTime Hired { get; set; }
}
All the other properties work fine. I just need to convert my date string to json date.