Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
Updating to AutoMapper 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jbogard authored and SteveSandersonMS committed Jul 18, 2016
1 parent f4afb25 commit edf1f88
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
19 changes: 11 additions & 8 deletions samples/angular/MusicStore/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ public void ConfigureServices(IServiceCollection services)
options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build());
});

Mapper.CreateMap<AlbumChangeDto, Album>();
Mapper.CreateMap<Album, AlbumChangeDto>();
Mapper.CreateMap<Album, AlbumResultDto>();
Mapper.CreateMap<AlbumResultDto, Album>();
Mapper.CreateMap<Artist, ArtistResultDto>();
Mapper.CreateMap<ArtistResultDto, Artist>();
Mapper.CreateMap<Genre, GenreResultDto>();
Mapper.CreateMap<GenreResultDto, Genre>();
Mapper.Initialize(cfg =>
{
cfg.CreateMap<AlbumChangeDto, Album>();
cfg.CreateMap<Album, AlbumChangeDto>();
cfg.CreateMap<Album, AlbumResultDto>();
cfg.CreateMap<AlbumResultDto, Album>();
cfg.CreateMap<Artist, ArtistResultDto>();
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.
Expand Down
2 changes: 1 addition & 1 deletion samples/angular/MusicStore/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
"Microsoft.AspNetCore.AngularServices": "1.0.0-*",
"AutoMapper": "4.1.1"
"AutoMapper": "5.0.2"
},
"frameworks": {
"netcoreapp1.0": {
Expand Down
19 changes: 11 additions & 8 deletions samples/react/MusicStore/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ public void ConfigureServices(IServiceCollection services)
options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build());
});

Mapper.CreateMap<AlbumChangeDto, Album>();
Mapper.CreateMap<Album, AlbumChangeDto>();
Mapper.CreateMap<Album, AlbumResultDto>();
Mapper.CreateMap<AlbumResultDto, Album>();
Mapper.CreateMap<Artist, ArtistResultDto>();
Mapper.CreateMap<ArtistResultDto, Artist>();
Mapper.CreateMap<Genre, GenreResultDto>();
Mapper.CreateMap<GenreResultDto, Genre>();
Mapper.Initialize(cfg =>
{
cfg.CreateMap<AlbumChangeDto, Album>();
cfg.CreateMap<Album, AlbumChangeDto>();
cfg.CreateMap<Album, AlbumResultDto>();
cfg.CreateMap<AlbumResultDto, Album>();
cfg.CreateMap<Artist, ArtistResultDto>();
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.
Expand Down
2 changes: 1 addition & 1 deletion samples/react/MusicStore/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
"Microsoft.AspNetCore.ReactServices": "1.0.0-*",
"AutoMapper": "4.1.1"
"AutoMapper": "5.0.2"
},
"frameworks": {
"netcoreapp1.0": {
Expand Down

0 comments on commit edf1f88

Please sign in to comment.