Hi. I want bind my cutom model (DenetlenenViewModel) but "Yil" property is List. How to bind model linq query?
My Custom Model
public class DenetlenenViewModel { public int Id { get; set; } public string FirmaAdi { get; set; } public List<int> Yil { get; set; } }
My Method
public IEnumerable<DenetlenenViewModel> YillarlaBirlikteGetir()
{
var firmalar = (from t in FASDBContext.Teklif
join d in FASDBContext.Denetlenen
on t.DenetlenenId.Value equals d.Id
select new DenetlenenViewModel
{
Id = d.Id,
FirmaAdi = d.FirmaAdi,
Yil = List<t.Yil> // Error : 'List<t.Yil>' is a type, which is not valid in the given context
}).ToList();
return firmalar;
}