Exemplo n.º 1
0
        public Task Handle(AvailabilityCreatedEvent message)
        {
            Availability availability = new Availability(
                message.Id,
                message.SiteId,
                message.StaffId,
                message.ServiceItemId,
                message.LocationId,
                message.StartDateTime,
                message.EndDateTime,
                message.Sunday,
                message.Monday,
                message.Tuesday,
                message.Wednesday,
                message.Thursday,
                message.Friday,
                message.Saturday,
                message.BookableEndDateTime);

            _availabilityRepository.Add(availability);
            _availabilityRepository.SaveChanges();
            return(Task.CompletedTask);
        }