A end point in Rest API WCF is as follows
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json, UriTemplate = "/getName")]
string getName(User user);
public string getName(User user)
{
//do what ever
}
Its json request is as follows:-
{
"user":
{
"FirstName":"nuser18",
"LastName":"nuser18" ,
......
......
......
}
}
I want to know how the User class' constructor is called when the API is hit from Postman. As I want to do some complex calculations in get set for properties based on if some properties are passed or not or if some values are sent or not or sent as null etc.