diff --git a/docs/en/CLI.md b/docs/en/CLI.md
index e0f4d29fb2..af7159bc22 100644
--- a/docs/en/CLI.md
+++ b/docs/en/CLI.md
@@ -105,6 +105,7 @@ abp add-module Volo.Blogging
* `--solution` or `-s`: Specifies the solution (.sln) file path. If not specified, CLI tries to find a .sln file in the current directory.
* `--skip-db-migrations`: For EF Core database provider, it automatically adds a new code first migration (`Add-Migration`) and updates the database (`Update-Database`) if necessary. Specify this option to skip this operation.
+* `-sp` or `--startup-project`: Relative path to the project folder of the startup project. Default value is the current folder.
### update
diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Cors/AbpCorsPolicyBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Cors/AbpCorsPolicyBuilderExtensions.cs
new file mode 100644
index 0000000000..e466b1e058
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Cors/AbpCorsPolicyBuilderExtensions.cs
@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Cors.Infrastructure;
+
+namespace Microsoft.AspNetCore.Cors
+{
+ public static class AbpCorsPolicyBuilderExtensions
+ {
+ public static CorsPolicyBuilder WithAbpExposedHeaders(this CorsPolicyBuilder corsPolicyBuilder)
+ {
+ return corsPolicyBuilder.WithExposedHeaders("_AbpErrorFormat");
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore/Volo.Abp.AspNetCore.csproj b/framework/src/Volo.Abp.AspNetCore/Volo.Abp.AspNetCore.csproj
index fb85cbb3ec..2584654ce8 100644
--- a/framework/src/Volo.Abp.AspNetCore/Volo.Abp.AspNetCore.csproj
+++ b/framework/src/Volo.Abp.AspNetCore/Volo.Abp.AspNetCore.csproj
@@ -32,6 +32,7 @@
+
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs
deleted file mode 100644
index c5db3405a8..0000000000
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using Volo.Abp.Application.Dtos;
-
-namespace Volo.Abp.Identity
-{
- public class GetIdentityRolesInput : PagedAndSortedResultRequestDto
- {
- public string Filter { get; set; }
- }
-}
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs
index 0d8f19f796..3fec60599d 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs
@@ -1,13 +1,21 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace Volo.Abp.Identity
{
- public interface IIdentityRoleAppService : ICrudAppService
+ public interface IIdentityRoleAppService : IApplicationService
{
- //TODO: remove after a better design
- Task> GetAllListAsync();
+ Task> GetListAsync();
+
+ Task CreateAsync(IdentityRoleCreateDto input);
+
+ Task GetAsync(Guid id);
+
+ Task UpdateAsync(Guid id, IdentityRoleUpdateDto input);
+
+ Task DeleteAsync(Guid id);
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs
index c91fc5ce1b..939d9739d2 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs
@@ -31,22 +31,11 @@ namespace Volo.Abp.Identity
);
}
- public async Task> GetListAsync(GetIdentityRolesInput input) //TODO: Remove this method since it's not used
+ public async Task> GetListAsync()
{
- var count = (int) await _roleRepository.GetCountAsync();
var list = await _roleRepository.GetListAsync();
- return new PagedResultDto(
- count,
- ObjectMapper.Map, List>(list)
- );
- }
-
- public async Task> GetAllListAsync() //TODO: Rename to GetList (however it's not possible because of the design of the IAsyncCrudAppService)
- {
- var list = await _roleRepository.GetListAsync();
-
- return ObjectMapper.Map, List>(list);
+ return new ListResultDto(ObjectMapper.Map, List>(list));
}
[Authorize(IdentityPermissions.Roles.Create)]
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
index ca11d75f48..35ec928f5c 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
@@ -21,16 +20,16 @@ namespace Volo.Abp.Identity
}
[HttpGet]
- [Route("{id}")]
- public virtual Task GetAsync(Guid id)
+ public virtual Task> GetListAsync()
{
- return _roleAppService.GetAsync(id);
+ return _roleAppService.GetListAsync();
}
[HttpGet]
- public virtual Task> GetListAsync(GetIdentityRolesInput input)
+ [Route("{id}")]
+ public virtual Task GetAsync(Guid id)
{
- return _roleAppService.GetListAsync(input);
+ return _roleAppService.GetAsync(id);
}
[HttpPost]
@@ -52,12 +51,5 @@ namespace Volo.Abp.Identity
{
return _roleAppService.DeleteAsync(id);
}
-
- [HttpGet]
- [Route("all")]
- public virtual Task> GetAllListAsync()
- {
- return _roleAppService.GetAllListAsync();
- }
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js
index 385b53f257..cde584cf20 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js
@@ -14,6 +14,9 @@
var _dataTable = _$table.DataTable(abp.libs.datatables.normalizeConfiguration({
order: [[1, "asc"]],
+ searching:false,
+ paging:false,
+ info:false,
ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList),
columnDefs: [
{
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs
index ce7a5a0507..4d36736501 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs
@@ -28,9 +28,9 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users
{
UserInfo = new UserInfoViewModel();
- var roleDtoList = await _identityRoleAppService.GetAllListAsync();
+ var roleDtoList = await _identityRoleAppService.GetListAsync();
- Roles = ObjectMapper.Map, AssignedRoleViewModel[]>(roleDtoList);
+ Roles = ObjectMapper.Map, AssignedRoleViewModel[]>(roleDtoList.Items);
foreach (var role in Roles)
{
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs
index 0655331fb9..1b166b881f 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs
@@ -30,8 +30,8 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users
{
UserInfo = ObjectMapper.Map(await _identityUserAppService.GetAsync(id));
- Roles = ObjectMapper.Map, AssignedRoleViewModel[]>(
- await _identityRoleAppService.GetAllListAsync()
+ Roles = ObjectMapper.Map, AssignedRoleViewModel[]>(
+ (await _identityRoleAppService.GetListAsync()).Items
);
var userRoleNames = (await _identityUserAppService.GetRolesAsync(UserInfo.Id)).Items.Select(r => r.Name).ToList();
diff --git a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs
index d20294da5c..03e872271f 100644
--- a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs
+++ b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs
@@ -38,11 +38,10 @@ namespace Volo.Abp.Identity
{
//Act
- var result = await _roleAppService.GetListAsync(new GetIdentityRolesInput());
+ var result = await _roleAppService.GetListAsync();
//Assert
- result.TotalCount.ShouldBeGreaterThan(0);
result.Items.Count.ShouldBeGreaterThan(0);
}
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
index cdf4e08d92..feef7b52bd 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
@@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
@@ -134,6 +135,7 @@ namespace MyCompanyName.MyProjectName
.Select(o => o.RemovePostFix("/"))
.ToArray()
)
+ .WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs
index 003edae216..979a3dd417 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs
@@ -3,6 +3,7 @@ using System.IO;
using System.Linq;
using System.Net.Http;
using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -133,6 +134,7 @@ namespace MyCompanyName.MyProjectName
.Select(o => o.RemovePostFix("/"))
.ToArray()
)
+ .WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
index 959bea22bb..a3b3bf27aa 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
@@ -3,6 +3,7 @@ using System.IO;
using System.Linq;
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
@@ -114,6 +115,7 @@ namespace MyCompanyName.MyProjectName
.Select(o => o.RemovePostFix("/"))
.ToArray()
)
+ .WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()