mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-10-31 10:37:04 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			777 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			777 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Linq;
 | |
| using API.DTOs;
 | |
| using API.Entities;
 | |
| using AutoMapper;
 | |
| 
 | |
| namespace API.Helpers
 | |
| {
 | |
|     public class AutoMapperProfiles : Profile
 | |
|     {
 | |
|         public AutoMapperProfiles()
 | |
|         {
 | |
|             CreateMap<LibraryDto, Library>();
 | |
| 
 | |
|             CreateMap<Volume, VolumeDto>();
 | |
| 
 | |
|             CreateMap<Series, SeriesDto>();
 | |
|             
 | |
|             CreateMap<Library, LibraryDto>()
 | |
|                 .ForMember(dest => dest.Folders,
 | |
|                     opt => 
 | |
|                         opt.MapFrom(src => src.Folders.Select(x => x.Path).ToList()));
 | |
|             
 | |
|             CreateMap<AppUser, MemberDto>()
 | |
|                 .AfterMap((ps, pst, context) => context.Mapper.Map(ps.Libraries, pst.Libraries));
 | |
| 
 | |
|             CreateMap<RegisterDto, AppUser>();
 | |
|         }
 | |
|     }
 | |
| } |