lundi 2 mai 2016

Can MVC deserialize the json string which is having perl_script naming convention

We are working with the third party vendor who is passing following object as part of Form post

    "application": 123,
    "order_reference": "01234",
    "new_status": "initialize"

As this is not the standard naming convention in C#, i created following model.

public class Response
    public string Application {get; set;}

    public string OrderReference {get; set;}

    public string NewStatus {get; set;}

And i have below code in controller.

public Notify(Response response)
   // code.

The request is coming to the above method, but the object is not deserializing, I could see that, only application property is getting mapped.

Could any one please let me know, whether i can make it work with the model i have created or do i have to create the same model as the response is coming?

Aucun commentaire:

Enregistrer un commentaire