ViewModel for the MailingList class
        public static MailingListViewModel Create(IRepositoryFactory repositoryFactory, string siteId, MailingList mailingList = null, int? seminarId = null)
        {
            Check.Require(repositoryFactory!= null, "Repository must be supplied");

            var site = SiteService.LoadSite(siteId);

            var viewModel = new MailingListViewModel
                                {
                                    MailingList = mailingList ?? new MailingList(),
                                    Seminars = site.Seminars,
                                    People = repositoryFactory.PersonRepository.GetAll(),
                                    SeminarId = seminarId
                                };

            return viewModel;
        }
Exemple #2
0
        public static MailingListViewModel Create(IRepositoryFactory repositoryFactory, string siteId, MailingList mailingList = null, int?seminarId = null)
        {
            Check.Require(repositoryFactory != null, "Repository must be supplied");

            var site = SiteService.LoadSite(siteId);

            var viewModel = new MailingListViewModel
            {
                MailingList = mailingList ?? new MailingList(),
                Seminars    = site.Seminars,
                People      = repositoryFactory.PersonRepository.GetAll(),
                SeminarId   = seminarId
            };

            return(viewModel);
        }