Can not implicitly convert type (object) to System.Collections.Generic.IEnumerable

1

I carry out the implementation of an API with the DDD architecture (Domain Driven Design) but when defining the method for deserialization of a json file from which it receives it of type string . But it throws me an error because it needs a collection IEnumerable . It is implemented as follows.

The code this

public class ProcesosService : IProcesosService
{
    private IRepository<Proceso> ProcesosRepository { get; set; }

    public ProcesosService(IRepository<Proceso> procesosRepository)
    {
        this.ProcesosRepository = procesosRepository;
    }


    public IEnumerable<RespuestaJson>  DeserializacionJson(string caso)
    {
        Caso deseriCaso = new Caso();
        deseriCaso = JsonConvert.DeserializeObject<Caso>(caso);

    }

    public IEnumerable<ProcesoListDto> ObtenerTodosLosProcesos()
    {
        throw new NotImplementedException();
    }
}


public interface IProcesosService
{
    IEnumerable<ProcesoListDto> ObtenerTodosLosProcesos();
    Caso DeserializacionJson(string v);
}

But do not know how to deserialize and treat that json with a list IEnumerable ?

    
asked by lARAPRO 14.09.2018 в 18:27
source

0 answers