public static EditNeedsViewModel FromEntities(Need s, List <Supplier> suppliers) { return(new EditNeedsViewModel { Request = NeedsViewModel.FromEntity(s), Status = PostStatusViewModel.FromEntity(s), Twitter = TwitterViewModel.FromEntity(s), NeedsMatching = NeedsMatchViewModel.FromEntities(s, suppliers), Location = LocationViewModel.FromEntity(s), Notes = NotesViewModel.FromNeed(s), }); }
public static List <NeedsMatchViewModel> FromEntities(Need s, List <Supplier> suppliers) { List <SelectListItem> supplierSelectListItems = SelectListItem_FromEntity.FromEntities(suppliers); return(s.NeedPpeTypes.SelectToList(p => NeedsMatchViewModel.FromEntity(p, supplierSelectListItems))); }