Example #1
0
        public static internalDTO.Event MapFromDAL(externalDTO.Event Event)
        {
            var res = Event == null ? null : new internalDTO.Event()
            {
                Id                      = Event.Id,
                Name                    = Event.Name,
                Description             = Event.Description,
                NextEventId             = Event.NextEventId,
                SubEventId              = Event.SubEventId,
                AppUserId               = Event.AppUserId,
                EventAdministrativeUnit = Event.AdministrativeUnits?.Select(item => new internalDTO.AdministrativeUnitInEvent()
                {
                    AdministrativeUnitId = item.Id,
                }).ToList(),
                EventLocations = Event.Locations?.Select(item => new internalDTO.EventInLocation()
                {
                    LocationId = item.Id,
                }).ToList(),
                EventTypes = Event.EventTypes?.Select(type => new internalDTO.EventInType()
                {
                    EventTypeId = type.Id,
                }).ToList(),
                ImageSrc  = Event.ImageSrc,
                EventDate = Event.EventDate
            };

            return(res);
        }
Example #2
0
        public static externalDTO.Event MapFromDAL(internalDTO.Event Event)
        {
            var res = Event == null ? null : new externalDTO.Event()
            {
                Id                  = Event.Id,
                Name                = Event.Name,
                Description         = Event.Description,
                AppUserId           = Event.AppUserId,
                AdministrativeUnits = Event.AdministrativeUnits?.Select(AdministrativeUnitMapper.MapFromDAL).ToList(),
                Locations           = Event.Locations?.Select(LocationMapper.MapFromDAL).ToList(),
                EventTypes          = Event.EventTypes?.Select(EventTypeMapper.MapFromDAL).ToList(),
                ImageSrc            = Event.ImageSrc,
                EventDate           = Event.EventDate
            };

            return(res);
        }