From edf1f88398d23209b92b22a5f9087e3420b594f2 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 3d5e263..a367d28 100755 --- a/samples/angular/MusicStore/Startup.cs +++ b/samples/angular/MusicStore/Startup.cs @@ -45,14 +45,17 @@ namespace MusicStore 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 d341cf1..ac5a938 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 4ea3fec..1bc6003 100755 --- a/samples/react/MusicStore/Startup.cs +++ b/samples/react/MusicStore/Startup.cs @@ -47,14 +47,17 @@ namespace MusicStore 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 faebf7a..6f5c801 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": {