how to perform a Json with the DDD architecture pattern

1

I have the following code in which a client makes a Http request of type Post with Json, so my question is how can I de-serialize that Json and extract its data. I already have created the classes where are the tributes of that Json file inside the Api. Below is the code of a controller method that receives the Post request.

  public IEnumerable<RespuestaJson> Post(Caso json)
    {
       return ProcesosService.DeserializacionJson(json);
    }

This is the fragment referred to in the previous block.

    public IEnumerable<RespuestaJson> DeserializacionJson(Caso caso)
    {
        Caso deseriCaso = new Caso();
        deseriCaso = JsonConvert.DeserializeObject<Caso>(caso.ToString());
        List<Caso> list = new List<Caso>();
        list.Add(caso);
        IEnumerable<string> en = list;
        return list;

    }
    
asked by lARAPRO 15.09.2018 в 00:18
source

0 answers