Exemplo n.º 1
0
 public void AddAccesToCalendar(
     MedicalStuffId medicalStuffId)
 {
     _calendarUsers.Add(CalendarUser.CreateNew(
                            Id,
                            medicalStuffId,
                            MedicalStuffRole.Nurse
                            ));
 }
        private async Task AddCalendarUser(CalendarUser calendarUser)
        {
            var connection = _sqlConnectionFactory.GetOpenConnection();
            var procedure  = "[InsertOrUpdateCalendarUser]";

            Thread.Sleep(100);
            await connection.QueryAsync(procedure, calendarUser.CreateNew(), commandType : CommandType.StoredProcedure);

            await _domainEventsDispatcher.DispatchEventsAsync(calendarUser.GetDomainEvents());
        }
Exemplo n.º 3
0
        public Calendar(
            string title,
            List <MedicalStuffId> nursesIds)
        {
            Id     = new CalendarId(Guid.NewGuid());
            _title = title;

            AddDomainEvent(new CalendarCreatedDomainEvent(Id));

            if (nursesIds.Any())
            {
                _calendarUsers = new List <CalendarUser>();
                nursesIds.ForEach(_ => {
                    _calendarUsers.Add(CalendarUser.CreateNew(Id,
                                                              _, MedicalStuffRole.Nurse));
                });
            }
        }