Skip to content

Commit 0baf811

Browse files
authored
Merge pull request #468 from aspnetboilerplate/maliming/patch-3
Eliminate warning messages for the project.
2 parents 244ffd5 + 2dd1d7a commit 0baf811

File tree

8 files changed

+17
-18
lines changed

8 files changed

+17
-18
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/AbpProjectNameApplicationModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override void Initialize()
2323

2424
Configuration.Modules.AbpAutoMapper().Configurators.Add(
2525
// Scan the assembly for classes which inherit from AutoMapper.Profile
26-
cfg => cfg.AddProfiles(thisAssembly)
26+
cfg => cfg.AddMaps(thisAssembly)
2727
);
2828
}
2929
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Controllers/RolesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task<IActionResult> Index()
3636
public async Task<ActionResult> EditRoleModal(int roleId)
3737
{
3838
var output = await _roleAppService.GetRoleForEdit(new EntityDto(roleId));
39-
var model = new EditRoleModalViewModel(output);
39+
var model = ObjectMapper.Map<EditRoleModalViewModel>(output);
4040

4141
return View("_EditRoleModal", model);
4242
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Models/Roles/EditRoleModalViewModel.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ namespace AbpCompanyName.AbpProjectName.Web.Models.Roles
77
[AutoMapFrom(typeof(GetRoleForEditOutput))]
88
public class EditRoleModalViewModel : GetRoleForEditOutput, IPermissionsEditViewModel
99
{
10-
public EditRoleModalViewModel(GetRoleForEditOutput output)
11-
{
12-
output.MapTo(this);
13-
}
14-
1510
public bool HasPermission(FlatPermissionDto permission)
1611
{
1712
return GrantedPermissionNames.Contains(permission.Name);

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Roles/_EditRoleModal.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@{
44
Layout = null;
55
}
6-
@Html.Partial("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditRole")))
6+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditRole")))
77

88
<div class="modal-body">
99
<form name="RoleEditForm" role="form" novalidate class="form-validation">
@@ -58,6 +58,6 @@
5858
</form>
5959
</div>
6060

61-
@Html.Partial("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
61+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
6262

6363
<script src="~/view-resources/Views/Roles/_EditRoleModal.js" asp-append-version="true"></script>

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Components/TenantChange/TenantChangeViewComponent.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
using System.Threading.Tasks;
22
using Microsoft.AspNetCore.Mvc;
33
using Abp.AutoMapper;
4+
using Abp.ObjectMapping;
45
using AbpCompanyName.AbpProjectName.Sessions;
56

67
namespace AbpCompanyName.AbpProjectName.Web.Views.Shared.Components.TenantChange
78
{
89
public class TenantChangeViewComponent : AbpProjectNameViewComponent
910
{
1011
private readonly ISessionAppService _sessionAppService;
12+
private readonly IObjectMapper _objectMapper;
1113

12-
public TenantChangeViewComponent(ISessionAppService sessionAppService)
14+
public TenantChangeViewComponent(ISessionAppService sessionAppService,
15+
IObjectMapper objectMapper)
1316
{
1417
_sessionAppService = sessionAppService;
18+
_objectMapper = objectMapper;
1519
}
1620

1721
public async Task<IViewComponentResult> InvokeAsync()
1822
{
1923
var loginInfo = await _sessionAppService.GetCurrentLoginInformations();
20-
var model = loginInfo.MapTo<TenantChangeViewModel>();
24+
var model = _objectMapper.Map<TenantChangeViewModel>(loginInfo);
2125
return View(model);
2226
}
2327
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Components/TenantChange/_ChangeModal.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
@{
66
Layout = null;
77
}
8-
@Html.Partial("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("ChangeTenant")))
8+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("ChangeTenant")))
99

1010
<div class="modal-body">
1111
<form name="TenantChangeForm" role="form" novalidate class="form-validation">
1212
<div class="form-group form-float">
1313
<div class="form-line">
14-
<input class="form-control" type="text" name="TenancyName" maxlength="@AbpTenantBase.MaxTenancyNameLength" value="@Model.TenancyName">
14+
<input class="form-control" type="text" name="TenancyName" maxlength="@AbpTenantBase.MaxTenancyNameLength.ToString()" value="@Model.TenancyName">
1515
<label class="form-label">@L("TenancyName")</label>
1616
</div>
1717
</div>
1818
<span class="help-block">@L("LeaveEmptyToSwitchToHost")</span>
1919
</form>
2020
</div>
2121

22-
@Html.Partial("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
22+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
2323

2424
<script src="~/view-resources/Views/Shared/Components/TenantChange/_ChangeModal.js" asp-append-version="true"></script>

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Tenants/_EditTenantModal.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@{
66
Layout = null;
77
}
8-
@Html.Partial("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditTenant")))
8+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditTenant")))
99

1010
<div class="modal-body">
1111
<form name="TenantEditForm" role="form" novalidate class="form-validation">
@@ -31,6 +31,6 @@
3131
</form>
3232
</div>
3333

34-
@Html.Partial("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
34+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
3535

3636
<script src="~/view-resources/Views/Tenants/_EditTenantModal.js" asp-append-version="true"></script>

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Users/_EditUserModal.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@{
44
Layout = null;
55
}
6-
@Html.Partial("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditUser")))
6+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditUser")))
77

88
<div class="modal-body">
99
<form name="UserEditForm" role="form" novalidate class="form-validation">
@@ -86,6 +86,6 @@
8686
</form>
8787
</div>
8888

89-
@Html.Partial("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
89+
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
9090

9191
<script src="~/view-resources/Views/Users/_EditUserModal.js" asp-append-version="true"></script>

0 commit comments

Comments
 (0)