@@ -45,14 +45,17 @@ public void ConfigureServices(IServiceCollection services)
4545 options . AddPolicy ( "app-ManageStore" , new AuthorizationPolicyBuilder ( ) . RequireClaim ( "app-ManageStore" , "Allowed" ) . Build ( ) ) ;
4646 } ) ;
4747
48- Mapper . CreateMap < AlbumChangeDto , Album > ( ) ;
49- Mapper . CreateMap < Album , AlbumChangeDto > ( ) ;
50- Mapper . CreateMap < Album , AlbumResultDto > ( ) ;
51- Mapper . CreateMap < AlbumResultDto , Album > ( ) ;
52- Mapper . CreateMap < Artist , ArtistResultDto > ( ) ;
53- Mapper . CreateMap < ArtistResultDto , Artist > ( ) ;
54- Mapper . CreateMap < Genre , GenreResultDto > ( ) ;
55- Mapper . CreateMap < GenreResultDto , Genre > ( ) ;
48+ Mapper . Initialize ( cfg =>
49+ {
50+ cfg . CreateMap < AlbumChangeDto , Album > ( ) ;
51+ cfg . CreateMap < Album , AlbumChangeDto > ( ) ;
52+ cfg . CreateMap < Album , AlbumResultDto > ( ) ;
53+ cfg . CreateMap < AlbumResultDto , Album > ( ) ;
54+ cfg . CreateMap < Artist , ArtistResultDto > ( ) ;
55+ cfg . CreateMap < ArtistResultDto , Artist > ( ) ;
56+ cfg . CreateMap < Genre , GenreResultDto > ( ) ;
57+ cfg . CreateMap < GenreResultDto , Genre > ( ) ;
58+ } ) ;
5659 }
5760
5861 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
0 commit comments