mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Updating to AutoMapper 5.0
This commit is contained in:
committed by
SteveSandersonMS
parent
f4afb25a2d
commit
edf1f88398
@@ -45,14 +45,17 @@ namespace MusicStore
|
|||||||
options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build());
|
options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build());
|
||||||
});
|
});
|
||||||
|
|
||||||
Mapper.CreateMap<AlbumChangeDto, Album>();
|
Mapper.Initialize(cfg =>
|
||||||
Mapper.CreateMap<Album, AlbumChangeDto>();
|
{
|
||||||
Mapper.CreateMap<Album, AlbumResultDto>();
|
cfg.CreateMap<AlbumChangeDto, Album>();
|
||||||
Mapper.CreateMap<AlbumResultDto, Album>();
|
cfg.CreateMap<Album, AlbumChangeDto>();
|
||||||
Mapper.CreateMap<Artist, ArtistResultDto>();
|
cfg.CreateMap<Album, AlbumResultDto>();
|
||||||
Mapper.CreateMap<ArtistResultDto, Artist>();
|
cfg.CreateMap<AlbumResultDto, Album>();
|
||||||
Mapper.CreateMap<Genre, GenreResultDto>();
|
cfg.CreateMap<Artist, ArtistResultDto>();
|
||||||
Mapper.CreateMap<GenreResultDto, Genre>();
|
cfg.CreateMap<ArtistResultDto, Artist>();
|
||||||
|
cfg.CreateMap<Genre, GenreResultDto>();
|
||||||
|
cfg.CreateMap<GenreResultDto, Genre>();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
||||||
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
|
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
|
||||||
"Microsoft.AspNetCore.AngularServices": "1.0.0-*",
|
"Microsoft.AspNetCore.AngularServices": "1.0.0-*",
|
||||||
"AutoMapper": "4.1.1"
|
"AutoMapper": "5.0.2"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.0": {
|
"netcoreapp1.0": {
|
||||||
|
|||||||
@@ -47,14 +47,17 @@ namespace MusicStore
|
|||||||
options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build());
|
options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build());
|
||||||
});
|
});
|
||||||
|
|
||||||
Mapper.CreateMap<AlbumChangeDto, Album>();
|
Mapper.Initialize(cfg =>
|
||||||
Mapper.CreateMap<Album, AlbumChangeDto>();
|
{
|
||||||
Mapper.CreateMap<Album, AlbumResultDto>();
|
cfg.CreateMap<AlbumChangeDto, Album>();
|
||||||
Mapper.CreateMap<AlbumResultDto, Album>();
|
cfg.CreateMap<Album, AlbumChangeDto>();
|
||||||
Mapper.CreateMap<Artist, ArtistResultDto>();
|
cfg.CreateMap<Album, AlbumResultDto>();
|
||||||
Mapper.CreateMap<ArtistResultDto, Artist>();
|
cfg.CreateMap<AlbumResultDto, Album>();
|
||||||
Mapper.CreateMap<Genre, GenreResultDto>();
|
cfg.CreateMap<Artist, ArtistResultDto>();
|
||||||
Mapper.CreateMap<GenreResultDto, Genre>();
|
cfg.CreateMap<ArtistResultDto, Artist>();
|
||||||
|
cfg.CreateMap<Genre, GenreResultDto>();
|
||||||
|
cfg.CreateMap<GenreResultDto, Genre>();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
||||||
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
|
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
|
||||||
"Microsoft.AspNetCore.ReactServices": "1.0.0-*",
|
"Microsoft.AspNetCore.ReactServices": "1.0.0-*",
|
||||||
"AutoMapper": "4.1.1"
|
"AutoMapper": "5.0.2"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.0": {
|
"netcoreapp1.0": {
|
||||||
|
|||||||
Reference in New Issue
Block a user