public AnnouncementViewModel(Post a) { Id = a.Id; Content = a.Content; StartDate = a.StartDate; Deadline = a.Deadline; MaxDuration = a.MaxDuration; EstimateTotal = a.EstimateTotal; AwardCeiling = a.AwardCeiling; AwardFloor = a.AwardFloor; PostDate = a.PostDate; Opportunity = (a.Opportunity != null) ? a.Opportunity.Name : string.Empty; }
public AnnouncementBindingModel(Post announcement, IEnumerable<Opportunity> opportunities) { Announcement = announcement; Opportunities = opportunities.ToSelectList(o => o.Id.ToString(), o => o.Name, announcement.Id.ToString()); }