Пример #1
0
        /// <summary>
        /// This method transforms EventDTO to Event
        /// </summary>
        /// <param name="l"></param>
        /// <returns>EventDTO of the Event</returns>

        public EventDTO Transform(Event l)
        {
            if (l == null)
            {
                return(null);
            }
            return(new EventDTO
            {
                EventId = l.EventId,
                EventName = l.EventName,
                ImageLink = l.ImageLink,
                EventDescription = l.EventDescription,
                EventPage = l.EventPage,
                EventDuration = l.EventDuration,
                EventType = _eventTypeFactory.Transform(l.EventType) ?? null
            });
        }
 public EventTypeDTO AddNewEventType(EventTypeDTO newEventType)
 {
     try
     {
         var et = _eventTypeFactory.Transform(newEventType);
         _uow.EventTypes.Add(et);
         _uow.SaveChanges();
         return(_eventTypeFactory.Transform(et));
     }
     catch (DBConcurrencyException)
     {
         return(null);
     }
 }