public UpcommingEventViewModel(OfficialEvent e) { Name = e.Title; Slug = e.Slug; AccreditationsEnabled = e.AccreditationsEnabled; OrdersEnabled = e.SubEvents.Any(s => s.Groups.Any()) && e.StartDate>DateTime.Today && !e.OrdersDisabled; TranslationEnabled = e.SubEvents.Any(s => s.TimingSystemId != null) && e.StartDate.AddDays(-2)>=DateTime.Today; StartDate = e.StartDate; FinishDate = e.FinishDate; }
public EventDashboardViewModel(OfficialEvent ev) { Description = ev.History; Partners = ev.SubEvents.SelectMany(e => e.Tag.Partners).Distinct().OrderBy(p => p.Position).Select(p => new PartnerListViewModel(p)).ToList(); Program = ev.SubEvents.Select(e => new ProgramItemViewModel(e)).ToList(); }