コード例 #1
0
        public static SessionPersonViewModel Create(IRepository repository, Session session, SeminarPerson seminarPerson = null)
        {
            Check.Require(repository != null, "Repository is required.");

            var seminar = repository.OfType<Seminar>().GetNullableById(session.Seminar.Id);

            var viewModel = new SessionPersonViewModel()
                                {
                                    SeminarPeople = seminar.SeminarPeople,
                                    Session = session,
                                    SeminarPerson = seminarPerson ?? new SeminarPerson()
                                };

            return viewModel;
        }
コード例 #2
0
        public static SessionPersonViewModel Create(IRepository repository, Session session, SeminarPerson seminarPerson = null)
        {
            Check.Require(repository != null, "Repository is required.");

            var seminar = repository.OfType <Seminar>().GetNullableById(session.Seminar.Id);

            var viewModel = new SessionPersonViewModel()
            {
                SeminarPeople = seminar.SeminarPeople,
                Session       = session,
                SeminarPerson = seminarPerson ?? new SeminarPerson()
            };

            return(viewModel);
        }