I am doing a query to search all the meteorologies with a certain date, but when executing the following error occurs:
An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user code
Additional information: The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities.
Follow the code below:
var metereologias = from b in db.Metereologias.Where(b => b.data_de_leitura.Equals(tmp[i]))
select new MetereologiaDTO()
{
metereologiaId = b.metereologiaId,
data_de_leitura = b.data_de_leitura,
hora_de_leitura = b.hora_de_leitura,
temperatura = b.temp,
vento = b.vento,
pressão = b.pressao,
NO = b.NO,
NO2 = b.NO2,
CO2 = b.CO2,
Local = b.Local.Nome
};
List<MetereologiaDTO> tmpResult = new List<MetereologiaDTO>(metereologias);