private IList <SelectListItem> BuildWorkList() { var works = workRepository.All(); return(works.Select(work => new SelectListItem() { Text = work.Description, Value = work.Id.ToString() }) .ToList()); }
public WorkListModel Build() { var works = workRepository.All(); var modelList = works.Select(work => new WorkListItemModel() { Id = work.Id, Description = work.Description, EngineType = work.EngineType }).ToList(); return(new WorkListModel(modelList)); }