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; }
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); }