Tabella_Pratiche is entities of my db, P_ListLettore is a list of object.
When I try join Tabella_Pratiche and P_ListLettore I produce exception.
Dim listPraticheEsistenti As List(Of Tabella_Pratiche)
listPraticheEsistenti = (From c In DB.Tabella_Pratiche Join b In P_ListLettore On c.posizione Equals b.AssignamentID And c.data_affido.ToString("dd/MM/yyyy") Equals b.R_RecordPA.Data_inizio_affidamento.ToString("dd/MM/yyyy") Where c.tipo_mandato = "SPG" Select c).ToList
exception " Eccezione non gestita di tipo 'System.NotSupportedException' in EntityFramework.SqlServer.dll
Ulteriori informazioni: Impossibile creare un valore costante di tipo 'ImportPratiche.RecordPrSPG'. In questo contesto sono supportati solo tipi primitivi o enumerazione. "
Containswhich is supported and will be translated into aINclause on the database but this only supports lists of simple types like a list ofintorstring.