From 1610a90251e7121a953a39b3c896f227b2de4f6f Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 3 Sep 2019 16:34:33 +0800 Subject: [PATCH] Resolve #1708 Use AddMaps instead of AddProfile in startup templates. --- .../MyProjectNameApplicationModule.cs | 6 +----- .../MyProjectNameWebModule.cs | 7 +------ .../MyProjectNameWebModule.cs | 8 ++------ .../MyProjectNameWebHostModule.cs | 7 +------ .../MyProjectNameApplicationModule.cs | 6 +----- .../MyProjectNameWebModule.cs | 6 +----- 6 files changed, 7 insertions(+), 33 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs index c3d4e00033..e9941ee6c3 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs @@ -23,11 +23,7 @@ namespace MyCompanyName.MyProjectName { Configure(options => { - /* Use `true` for the `validate` parameter if you want to - * validate the profile on application startup. - * See http://docs.automapper.org/en/stable/Configuration-validation.html for more info - * about the configuration validation. */ - options.AddProfile(); + options.AddMaps(); }); } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs index 97a8914c01..301a53f28d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs @@ -130,12 +130,7 @@ namespace MyCompanyName.MyProjectName.Web { Configure(options => { - /* use `true` for the `validate` parameter if you want to - * validate the profile on application startup. - * See http://docs.automapper.org/en/stable/Configuration-validation.html for more - * about configuration validation. - */ - options.AddProfile(); + options.AddMaps(); }); } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index a5c83137dc..160f437c20 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -98,12 +98,8 @@ namespace MyCompanyName.MyProjectName.Web { Configure(options => { - /* use `true` for the `validate` parameter if you want to - * validate the profile on application startup. - * See http://docs.automapper.org/en/stable/Configuration-validation.html for more - * about configuration validation. - */ - options.AddProfile(); + options.AddMaps(); + }); } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs index 30e9c6aa91..71d5f6507f 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs @@ -135,12 +135,7 @@ namespace MyCompanyName.MyProjectName { Configure(options => { - /* use `true` for the `validate` parameter if you want to - * validate the profile on application startup. - * See http://docs.automapper.org/en/stable/Configuration-validation.html for more - * about configuration validation. - */ - options.AddProfile(); + options.AddMaps(); }); } diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs index 182ca13137..7b6410654a 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs @@ -14,11 +14,7 @@ namespace MyCompanyName.MyProjectName { Configure(options => { - /* Using `true` for the `validate` parameter to - * validate the profile on application startup. - * See http://docs.automapper.org/en/stable/Configuration-validation.html for more info - * about the configuration validation. */ - options.AddProfile(validate: true); + options.AddMaps(validate: true); }); } } diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 747978bc88..36662c1848 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -39,11 +39,7 @@ namespace MyCompanyName.MyProjectName.Web Configure(options => { - /* Using `true` for the `validate` parameter to - * validate the profile on application startup. - * See http://docs.automapper.org/en/stable/Configuration-validation.html for more info - * about the configuration validation. */ - options.AddProfile(validate: true); + options.AddMaps(validate: true); }); Configure(options =>