Пример #1
0
        public ActionResult Account(string userName)
        {
            notificationFacade.DeleteStaleNotifications();
            var prs = personFacade.GetPeople(new PersonFilter {
                Email = userName
            }).First();
            var personEditViewModel = new PersonEditViewModel()
            {
                Person = personFacade.GetPeople(new PersonFilter {
                    Email = userName
                }).First(),
                Notifications = notificationFacade
                                .GetNotifications(new NotificationFilter {
                    PersonRecipient = prs.Id, Seen = false
                })
                                .OrderBy(y => y.CreationTime).ToList()
            };

            personEditViewModel.Notifications.ForEach(y => notificationFacade.MarkAsSeen(y.Id));

            notificationFacade.DeleteByIds(personEditViewModel.Notifications.Select(y => y.Id).ToArray());
            return(View(personEditViewModel));
        }