public PastSiteDetail(IPastWorkRepository pastWork, string id) { _pastWork = pastWork; var pastSite = pastWork.GetSiteById(Convert.ToInt32(id)); var obj = pastSite.Select(p => new { id = p.Id, title = p.Title, client = p.Client, summary = p.Summary, url = p.Url, skills = p.Skills .Select(s => new { title = s.SkillName }), roles = p.Roles.OrderBy(o=>o.Title) .Select(r => new { title = r.Title }), images = p.Images .Select(i => new { image = i.ImageName }) }).Single(); site = obj; }
public PastSites(IPastWorkRepository pastWork) { _pastWork = pastWork; Sites = _pastWork.GetAllSites().ToList(); }