I have the following;
var res = d.Select(r => new MPageModel
{
Url = r[0],
PageTitle = r[1],
Value = r[2]
});
It works. But I need to lookup Url and PageTitle in a database, based on the value from r[0]. So something like;
var res = d.Select(r => new MPageModel
{
var dbitem = GetDbItem(r[0]);
Url = dbitem.Url,
PageTitle = dbitem.Title,
Value = r[2]
});
Obviously this is not at all valid, but I hope it illustrates, what i am trying to do. What is the correct apporach?