我有以下功能
public List<Object> GetEventsForAdmin()
{
using (var dbEntities = new CapeledEntities())
{
return (from e in dbEntities.Events
join lnk in dbEntities.linkEventCategories on e.EventId equals lnk.EventId
join cat in dbEntities.Categories on lnk.CategoryId equals cat.CategoryId
orderby e.StartDateTime descending
select new {
e.EventId,
EventTitle = e.Title,
e.StartDateTime,
e.Description,
CatTitle = cat.Title
}
).ToList<Object>();
}
}
我在用
var eventHelper = new BusinessLogic.DatabaseAccess.Helpers.BLEvents();
foreach (var myEvent in eventHelper.GetEventsForAdmin())
{
txtTitle.text = myEvent.CatTitle;
txtDescription.text = myEvent.description;
}
但是找不到 myEvent.CatTitle 和 myEvent.description 啊
}