예제 #1
0
        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()));
        }
예제 #2
0
        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));
        }