Hello Guys!
Somebody help me with this error?
I have this method:
public List<AnoMOD> CarregarAnos() { using (var conexao = new Entities()) { return conexao.CEUS_EVENTOS.ToList().ConvertAll<AnoMOD>(x => { return new AnoMOD { dtAno = Convert.ToString(x.DTEVENTO.Year) }; }).Distinct(); } }
When i try to compile, this error appears:
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<CeusPontos.WebAPI.Models.AnoMOD>' to 'System.Collections.Generic.List<CeusPontos.WebAPI.Models.AnoMOD>'. An explicit conversion exists (are you missing a cast?) E:\Projetos\CeusPontos.WebAPI\Controllers\AnoController.cs 37 19 CeusPontos.WebAPI</div>