Пример #1
0
        public ActionResult Edit(Guid id)
        {
            Note note;

            using (var context = new ReadModelContext())
            {
                note = context.Notes.Single(n => n.Id == id);
            }

            var command = new ChangeNoteText();
            command.Id = id;
            command.Text = note.Text;

            return View(command);
        }
Пример #2
0
        public ActionResult Index()
        {
            IEnumerable<Note> notes;

            using (var context = new ReadModelContext())
            {
                var query = from item in context.Notes
                            orderby item.CreationDate
                            select item;

                notes = query.ToArray();
            }

            return View(notes);
        }
Пример #3
0
        public ActionResult Report()
        {
            IEnumerable<DailyStatistics> dailyStatistics;

            using (var context = new ReadModelContext())
            {
                var query = from item in context.DailyStatistics
                            orderby item.Date descending
                            select item;

                dailyStatistics = query.ToArray();
            }

            return View(dailyStatistics);
        }