Domanda

Il seguente codice sorgente:

                sectors1 = from sector in db.GetTable<InfrSect>();

                sectors2 = from sector in sector1
                          join team in db.GetTable<Team>() on sector.TeamId equals team.Id
                          where team.CountryId == iCountryId
                          select sector;


                IList<InfrSect> list = sectors2.ToList<>();

Genera la seguente query:

SELECT sector.team as TeamId
FROM infr_sect sector
INNER JOIN Team t1 ON sector.team = t1.Id
WHERE t1.Country =

La query generato non contiene il parametro 'iCountryId'.

Perché? Come posso correggere l'errore?

Grazie.

È stato utile?

Soluzione

Il problema era in provider di DB personalizzato. Non ho menzionato in questione che uso DB MySQL. Ho sostituito il codice sorgente del mio MySqlDataProvider con un codice sorgente della stessa classe dal codice sorgente BLToolkit e tutto è diventato praticabile.

Questo è il link per soluzione sul 'forum di supporto BLToolKit': http: // rsdn.ru/forum/prj.rfd/4109840.aspx

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top