Example #1
0
        public IEnumerable <CdLabelViewModel> GetCdLabelForEvent(long eventId)
        {
            var eventCustomers = _eventCustomerRepository.GetEventCustomersForCdLabel(eventId);

            if (eventCustomers == null || eventCustomers.Count() < 1)
            {
                return(null);
            }

            var customerIds = eventCustomers.Select(ec => ec.CustomerId).ToArray();

            var customers = _customerRepository.GetCustomers(customerIds);
            var eventData = _eventRepository.GetById(eventId);

            return(_cdLabelViewModelFactory.Create(eventCustomers, customers, eventData));
        }