Some api work
This commit is contained in:
parent
b6e0e05205
commit
8156aeb495
9 changed files with 82 additions and 64 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using API.DTOs;
|
||||
using API.Entities;
|
||||
using AutoMapper;
|
||||
|
@ -9,11 +10,15 @@ namespace API.Helpers
|
|||
{
|
||||
public AutoMapperProfiles()
|
||||
{
|
||||
CreateMap<AppUser, MemberDto>();
|
||||
CreateMap<LibraryDto, Library>();
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue