From 577ef4c69d623557a0df76fd13f37c54711454fa Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Mon, 18 Jul 2016 09:52:17 -0500 Subject: [PATCH] Updating to AutoMapper 5.0 --- samples/angular/MusicStore/Startup.cs | 19 +++++++++++-------- samples/angular/MusicStore/project.json | 2 +- samples/react/MusicStore/Startup.cs | 19 +++++++++++-------- samples/react/MusicStore/project.json | 2 +- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/samples/angular/MusicStore/Startup.cs b/samples/angular/MusicStore/Startup.cs index 3d5e2636..a367d28f 100755 --- a/samples/angular/MusicStore/Startup.cs +++ b/samples/angular/MusicStore/Startup.cs @@ -45,14 +45,17 @@ public void ConfigureServices(IServiceCollection services) options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build()); }); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); + Mapper.Initialize(cfg => + { + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/samples/angular/MusicStore/project.json b/samples/angular/MusicStore/project.json index d341cf13..ac5a9387 100755 --- a/samples/angular/MusicStore/project.json +++ b/samples/angular/MusicStore/project.json @@ -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": { diff --git a/samples/react/MusicStore/Startup.cs b/samples/react/MusicStore/Startup.cs index 4ea3fec3..1bc6003d 100755 --- a/samples/react/MusicStore/Startup.cs +++ b/samples/react/MusicStore/Startup.cs @@ -47,14 +47,17 @@ public void ConfigureServices(IServiceCollection services) options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build()); }); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); + Mapper.Initialize(cfg => + { + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/samples/react/MusicStore/project.json b/samples/react/MusicStore/project.json index faebf7ac..6f5c801b 100755 --- a/samples/react/MusicStore/project.json +++ b/samples/react/MusicStore/project.json @@ -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": {