示例#1
0
        public AutoMapperProfile()
        {
            CreateMap <EventVenueEntity, EventVenueListItemDto>();
            CreateMap <EventVenueEntity, EventVenueDetailDto>()
            .ReverseMap();

            CreateMap <EventEntity, EventListItemDto>();
            CreateMap <EventEntity, EventDetailDto>()
            .ReverseMap();

            CreateMap <CheckInEntity, CheckInListItemDto>();
            CreateMap <CheckInEntity, CheckInDetailDto>()
            .ReverseMap();

            CreateMap <string, RegionType>()
            .ConvertUsing(s => RegionType.FromName(s, true));

            CreateMap <string, EventType>()
            .ConvertUsing(s => EventType.FromName(s, true));

            CreateMap <RoomEntity, RoomListItemDto>();
            CreateMap <RoomEntity, RoomDetailDto>()
            .ReverseMap();
        }