public virtual ActionResult List(int noteId) { var model = new NoteImageDataSource(); model.NoteId = noteId; model.Images = Mapper.Map <List <NoteImageViewModel> >(_imagesRepository.GetByNoteId(noteId)); model.SetActions(); return(View(MVC.Shared.Views._Grid, model.GetGridModel())); }
public virtual ActionResult Notes() { var list = new List <TurtleBarrelViewModel>(); var notes = _notesRepository.Notes.OrderByDescending(x => x.Date); foreach (var note in notes) { list.Add(new TurtleBarrelViewModel() { Note = Mapper.Map <NoteViewModel>(note), Images = Mapper.Map <IEnumerable <NoteImageViewModel> >(_imagesRepository.GetByNoteId(note.Id)) }); } return(View(list)); }