I have method :
public DzieckoAndOpiekunCollection GetChildAndOpiekunByFirstnameLastname(string firstname, string lastname)
{
DataTransfer.ChargeInSchoolEntities db = new DataTransfer.ChargeInSchoolEntities();
DzieckoAndOpiekunCollection result = new DzieckoAndOpiekunCollection();
if (firstname == null && lastname != null)
{
IList<DzieckoAndOpiekun> resultV = from p in db.Dziecko
where lastname == p.Nazwisko
**select** new DzieckoAndOpiekun(
p.Imie,
p.Nazwisko,
p.Opiekun.Imie,
p.Opiekun.Nazwisko)
;
result.AddRange(resultV);
}
return result;
}
and error in selected place :
Error 1 Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Collections.Generic.IList'. An explicit conversion exists (are you missing a cast?)
Any idea how solve my problem ? :/