私は次の機能を持っています
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 が見つかりません。
}