public Seminar(CreateSeminar cmd) { Id = cmd.Id; Name = cmd.Name; LecturerId = cmd.LecturerId; RegisteredAttendees = new List <SeminarAttendee>(); }
public async Task CreateAsync(CreateSeminar cmd) { cmd.Validate(); var exists = await _seminarDao.ExistsAsync(cmd.Id); if (exists) { throw new ObjectAlreadyExitsException(cmd.Id, typeof(Seminar)); } await _seminarDao.AddAsync(new Seminar(cmd)); }