Example #1
0
        public CrudEvent GetCrudEventViewModelById(string eventId)
        {
            var e = _eventsRepository.GetEventById(eventId);

            var crudEvent = new CrudEvent
            {
                Id           = e.Id.Value,
                ClientId     = e.ClientId.Value,
                Title        = e.Title.TitleValue,
                StartsAt     = e.StartsAt.Value,
                Address      = e.Location.Address,
                LocationType = e.Location.Type,
                Description  = e.Description.DescriptionValue,
                EndsAt       = e.EndsAt.Value,
                Audience     = e.Audience,
                Type         = e.Type,
                Pictures     = _picturesRepository.GetPicturesForEvent(e.Id.Value).Select(p => p.Link).ToList(),
                IsActive     = e.IsActive,
                PublishDate  = e.PublishDate.Value
            };

            return(crudEvent);
        }
Example #2
0
        public UserEventDetails GetUserEventDetailsById(string eventId)
        {
            var e = _eventsRepository.GetEventById(eventId);

            var eventDetails = new UserEventDetails
            {
                Id              = e.Id.Value,
                Title           = e.Title.TitleValue,
                StartsAt        = e.StartsAt.Value,
                LocationAddress = e.Location.Address,
                LocationType    = e.Location.Type.ToString(),
                Description     = e.Description.DescriptionValue,
                EndsAt          = e.EndsAt.Value,
                Audience        = e.Audience.ToString(),
                Type            = e.Type.ToString(),
                Pictures        = _picturesRepository.GetPicturesForEvent(e.Id.Value).Select(p => p.Link).ToList()
            };

            return(eventDetails);
        }