Browse Source

Merge branch 'dev' of https://github.com/volosoft/abp into dev

pull/1962/head
Alper Ebicoglu 7 years ago
parent
commit
9c32b7079b
  1. 10
      docs/en/Index.md
  2. 3
      docs/zh-Hans/AspNetCore/JavaScript-API/Auth.md
  3. 24
      docs/zh-Hans/AspNetCore/JavaScript-API/Index.md
  4. 370
      docs/zh-Hans/Authorization.md
  5. 3
      docs/zh-Hans/JavaScript/Dynamic-JavaScript-API-Clients.md
  6. 3
      docs/zh-Hans/Modules/Permission-Management.md
  7. BIN
      docs/zh-Hans/images/authorization-new-permission-ui-hierarcy.png
  8. BIN
      docs/zh-Hans/images/authorization-new-permission-ui-localized.png
  9. BIN
      docs/zh-Hans/images/authorization-new-permission-ui.png
  10. BIN
      docs/zh-Hans/images/create-aspnet-core-application.png
  11. BIN
      docs/zh-Hans/images/create-new-aspnet-core-application-v2.png
  12. BIN
      docs/zh-Hans/images/select-empty-web-application-v2.png
  13. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml
  14. 7
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs
  15. 13
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs
  16. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs
  17. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs
  18. 2
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs
  19. 1
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs
  20. 171
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs
  21. 33
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs
  22. 8
      framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
  23. 4
      framework/src/Volo.Abp.Cli/Volo.Abp.Cli.csproj
  24. 2
      framework/src/Volo.Abp.Core/Volo/Abp/Aspects/AbpCrossCuttingConcerns.cs
  25. 2
      framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj
  26. 2
      framework/src/Volo.Abp.Features/Volo/Abp/Features/DefaultValueSettingValueProvider.cs
  27. 2
      framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs
  28. 2
      framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs
  29. 2
      framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj
  30. 2
      framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj
  31. 2
      framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj
  32. 2
      framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj
  33. 2
      framework/src/Volo.Abp.Settings/Volo/Abp/Settings/DefaultValueSettingValueProvider.cs
  34. 2
      framework/src/Volo.Abp.Settings/Volo/Abp/Settings/GlobalSettingValueProvider.cs
  35. 2
      framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs
  36. 2
      framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs
  37. 8
      framework/src/Volo.Abp.Validation/Volo/Abp/Validation/MethodInvocationValidator.cs
  38. 3
      framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ObjectValidator.cs
  39. 15
      framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs
  40. 2
      framework/test/AbpTestBase/AbpTestBase.csproj
  41. 2
      framework/test/Volo.Abp.AspNetCore.Authentication.OAuth.Tests/Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj
  42. 2
      framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo.Abp.AspNetCore.MultiTenancy.Tests.csproj
  43. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo.Abp.AspNetCore.Mvc.Tests.csproj
  44. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj
  45. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj
  46. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo.Abp.AspNetCore.Mvc.UI.Tests.csproj
  47. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj
  48. 2
      framework/test/Volo.Abp.AspNetCore.Tests/Volo.Abp.AspNetCore.Tests.csproj
  49. 2
      framework/test/Volo.Abp.Auditing.Tests/Volo.Abp.Auditing.Tests.csproj
  50. 2
      framework/test/Volo.Abp.Authorization.Tests/Volo.Abp.Authorization.Tests.csproj
  51. 2
      framework/test/Volo.Abp.AutoMapper.Tests/Volo.Abp.AutoMapper.Tests.csproj
  52. 2
      framework/test/Volo.Abp.Autofac.Tests/Volo.Abp.Autofac.Tests.csproj
  53. 2
      framework/test/Volo.Abp.BackgroundJobs.Tests/Volo.Abp.BackgroundJobs.Tests.csproj
  54. 2
      framework/test/Volo.Abp.Caching.Tests/Volo.Abp.Caching.Tests.csproj
  55. 187
      framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs
  56. 29
      framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/PersonCacheItem.cs
  57. 2
      framework/test/Volo.Abp.Castle.Core.Tests/Volo.Abp.Castle.Core.Tests.csproj
  58. 2
      framework/test/Volo.Abp.Cli.Core.Tests/Volo.Abp.Cli.Core.Tests.csproj
  59. 2
      framework/test/Volo.Abp.Core.Tests/Volo.Abp.Core.Tests.csproj
  60. 2
      framework/test/Volo.Abp.Dapper.Tests/Volo.Abp.Dapper.Tests.csproj
  61. 2
      framework/test/Volo.Abp.Data.Tests/Volo.Abp.Data.Tests.csproj
  62. 2
      framework/test/Volo.Abp.Ddd.Tests/Volo.Abp.Ddd.Tests.csproj
  63. 2
      framework/test/Volo.Abp.Emailing.Tests/Volo.Abp.Emailing.Tests.csproj
  64. 2
      framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo.Abp.EntityFrameworkCore.Tests.csproj
  65. 2
      framework/test/Volo.Abp.EventBus.Tests/Volo.Abp.EventBus.Tests.csproj
  66. 2
      framework/test/Volo.Abp.Features.Tests/Volo.Abp.Features.Tests.csproj
  67. 2
      framework/test/Volo.Abp.FluentValidation.Tests/Volo.Abp.FluentValidation.Tests.csproj
  68. 2
      framework/test/Volo.Abp.Http.Client.Tests/Volo.Abp.Http.Client.Tests.csproj
  69. 2
      framework/test/Volo.Abp.Ldap.Tests/Volo.Abp.Ldap.Tests.csproj
  70. 2
      framework/test/Volo.Abp.Localization.Tests/Volo.Abp.Localization.Tests.csproj
  71. 2
      framework/test/Volo.Abp.MailKit.Tests/Volo.Abp.MailKit.Tests.csproj
  72. 2
      framework/test/Volo.Abp.MemoryDb.Tests/Volo.Abp.MemoryDb.Tests.csproj
  73. 4
      framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj
  74. 2
      framework/test/Volo.Abp.MultiTenancy.Tests/Volo.Abp.MultiTenancy.Tests.csproj
  75. 2
      framework/test/Volo.Abp.ObjectMapping.Tests/Volo.Abp.ObjectMapping.Tests.csproj
  76. 2
      framework/test/Volo.Abp.Security.Tests/Volo.Abp.Security.Tests.csproj
  77. 2
      framework/test/Volo.Abp.Serialization.Tests/Volo.Abp.Serialization.Tests.csproj
  78. 2
      framework/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj
  79. 2
      framework/test/Volo.Abp.Specifications.Tests/Volo.Abp.Specifications.Tests.csproj
  80. 2
      framework/test/Volo.Abp.TestApp.Tests/Volo.Abp.TestApp.Tests.csproj
  81. 2
      framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj
  82. 2
      framework/test/Volo.Abp.UI.Navigation.Tests/Volo.Abp.UI.Navigation.Tests.csproj
  83. 2
      framework/test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj
  84. 2
      framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj
  85. 2
      framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj
  86. 2
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/DemoAppModule.cs
  87. 2
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDomainSharedModule.cs
  88. 6
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDomainModule.cs
  89. 4
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs
  90. 4
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreModule.cs
  91. 4
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbModule.cs
  92. 4
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDomainTestModule.cs
  93. 2
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo/Abp/BackgroundJobs/BackgroundJobsDomainTestBase.cs
  94. 6
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreTestModule.cs
  95. 2
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobRepositoryTests.cs
  96. 6
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs
  97. 2
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobRepositoryTests.cs
  98. 4
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestBaseModule.cs
  99. 2
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js
  100. 2
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js

10
docs/en/Index.md

@ -4,18 +4,12 @@ ABP is an **open source application framework** focused on ASP.NET Core based we
Explore the left navigation menu to deep dive in the documentation.
## Project Status
ABP is the **next generation** of the open source [ASP.NET Boilerplate](https://aspnetboilerplate.com/) framework. It's currently in preview stage and not ready to use in production. The documentation is still in progress and it is far from complete.
For short-term and production level applications, it's suggested to use [ASP.NET Boilerplate](https://aspnetboilerplate.com/) framework which has rich feature set, mature, actively maintained and up-to-date.
## Getting Started
Easiest way to start a new project with ABP is to use the startup templates:
* [ASP.NET Core MVC (Razor Pages) UI Template](Getting-Started-AspNetCore-MVC-Template.md)
* [Angular UI Template](Getting-Started-Angular-Template.md)
* [ASP.NET Core MVC (Razor Pages) UI Startup Template](Getting-Started-AspNetCore-MVC-Template.md)
* [Angular UI Startup Template](Getting-Started-Angular-Template.md)
If you want to start from scratch (with an empty project) then manually install the ABP Framework and use the following tutorials:

3
docs/zh-Hans/AspNetCore/JavaScript-API/Auth.md

@ -0,0 +1,3 @@
# abp.auth JavaScript API
TODO

24
docs/zh-Hans/AspNetCore/JavaScript-API/Index.md

@ -0,0 +1,24 @@
# JavaScript API
ABP为ASP.NET Core MVC / Razor页面应用程序提供了一些执行客户端常见需求的JavaScrpt Api.
## APIs
* abp.ajax
* [abp.auth](Auth.md)
* abp.currentUser
* abp.dom
* abp.event
* abp.features
* abp.localization
* abp.log
* abp.ModalManager
* abp.notify
* abp.security
* abp.setting
* abp.ui
* abp.utils
* abp.ResourceLoader
* abp.WidgetManager
* Other APIs

370
docs/zh-Hans/Authorization.md

@ -0,0 +1,370 @@
# 授权
授权用于在应用程序中判断是否允许用户执行某些特定的操作.
ABP扩展了[ASP.NET Core 授权](https://docs.microsoft.com/zh-cn/aspnet/core/security/authorization/introduction), 将 **权限** 添加为自动[策略](https://docs.microsoft.com/zh-cn/aspnet/core/security/authorization/policies)并且使授权系统在 **[应用服务](Application-Services.md)** 同样可用.
所以ASP.NET Core授权的功能特性和它的文档在基于ABP的应用程序是可用的.
本文中着重介绍在ASP.NET Core授权功能基础上添加的功能.
## Authorize Attribute
ASP.NET Core 定义了 [**Authorize**](https://docs.microsoft.com/zh-cn/aspnet/core/security/authorization/simple) attribute 用于在控制器,控制器方法以及页面上授权. 现在ABP将它带到了[应用服务](Application-Services.md).
示例:
````csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Services;
namespace Acme.BookStore
{
[Authorize]
public class AuthorAppService : ApplicationService, IAuthorAppService
{
public Task<List<AuthorDto>> GetListAsync()
{
...
}
[AllowAnonymous]
public Task<AuthorDto> GetAsync(Guid id)
{
...
}
[Authorize("BookStore_Author_Create")]
public Task CreateAsync(CreateAuthorDto input)
{
...
}
}
}
````
* `Authorize` attribute 使用户必须登陆到应用程序才可以访问 `AuthorAppService` 中的方法. 所以`GetListAsync` 方法仅可用于通过身份验证的用户.
* `AllowAnonymous` 禁用身份验证. 所以 `GetAsync` 方法任何人都可以访问,包括未授权的用户.
* `[Authorize("BookStore_Author_Create")]` 定义了一个策略 (参阅 [基于策略的授权](https://docs.microsoft.com/zh-cn/aspnet/core/security/authorization/policies)),它用于检查当前用户的权限.
"BookStore_Author_Create" 是一个策略名称. 如果你想要使用策略的授权方式,需要在ASP.NET Core授权系统中预先定义它.
你可以按照ASP.NET Core文档进行实施策略授权,但对于简单的 `true/false` 条件(比如是否授予了用户策略) ABP定义了权限系统,在下一部分中会进行讲解.
## 权限系统
权限系统是为特定用户,角色或客户端授权或禁止的简单策略.
### 定义权限
创建一个继承自 `PermissionDefinitionProvider` 的类,如下所示:
````csharp
using Volo.Abp.Authorization.Permissions;
namespace Acme.BookStore.Permissions
{
public class BookStorePermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var myGroup = context.AddGroup("BookStore");
myGroup.AddPermission("BookStore_Author_Create");
}
}
}
````
> ABP会自动发现这个类,不需要进行配置!
你需要在 `Define` 方法中添加**权限组**或者获取已存在的权限组,并向权限组中添加**权限**.
在定义权限后就可以在ASP.NET Core权限系统中当做**策略**名称使用. 在角色的权限管理模态框中同样可以看到:
![authorization-new-permission-ui](images/authorization-new-permission-ui.png)
* 左边的选项卡显示了 "BookStore" 权限组.
* 右侧的 "BookStore_Author_Create" 是权限名称,在这里可以为角色授权或禁止.
保存后更改会持久化到数据库并在授权系统使用.
> 只有在你安装了identity模块时,才会出现上图中的管理对话框. 该模块用于用户和角色的. 启动模板中已经预装identity模块.
#### 本地化权限名称
"BookStore_Author_Create" 名称对于权限系统来说很适合,但对于UI展示会让操作人员费解. 幸运的是 `AddPermission` 和 `AddGroup` 方法提供了 `LocalizableString` 参数:
````csharp
var myGroup = context.AddGroup(
"BookStore",
LocalizableString.Create<BookStoreResource>("BookStore")
);
myGroup.AddPermission(
"BookStore_Author_Create",
LocalizableString.Create<BookStoreResource>("Permission:BookStore_Author_Create")
);
````
然后在本地化文档中对 "BookStore" 和 "Permission:BookStore_Author_Create" 键添加本地化语言:
````json
"BookStore": "Book Store",
"Permission:BookStore_Author_Create": "Creating a new author"
````
> 有关更多信息请参阅[本地化系统文档](Localization.md).
下图展示了本地化后的效果:
![authorization-new-permission-ui-localized](images/authorization-new-permission-ui-localized.png)
#### 多租户
权限系统同样支持在ABP中做为一等公民的 [多租户](Multi-Tenancy.md). 在定义新权限时可以设置多租户选项. 有下面三个值:
* **Host**: 权限仅适用于宿主.
* **Tenant**: 权限仅适用于租户.
* **Both** (默认): 权限适用与宿主和租户.
> 如果你的应用程序不是多租户的,可以忽略这个选项.
`AddPermission` 方法的第三个参数用于设置多租户选项:
````csharp
myGroup.AddPermission(
"BookStore_Author_Create",
LocalizableString.Create<BookStoreResource>("Permission:BookStore_Author_Create"),
multiTenancySide: MultiTenancySides.Tenant //set multi-tenancy side!
);
````
#### 子权限
权限可以具有子权限,当你想要创建一个层次结构的权限树时它特别有用. 在这个树中一个权限可能含有子权限,并且子权限只有在授权父权限时才可用.
定义示例:
````csharp
var authorManagement = myGroup.AddPermission("Author_Management");
authorManagement.AddChild("Author_Management_Create_Books");
authorManagement.AddChild("Author_Management_Edit_Books");
authorManagement.AddChild("Author_Management_Delete_Books");
````
在页面上如下所示 (你可能想要本地化权限名称):
![authorization-new-permission-ui-hierarcy](images/authorization-new-permission-ui-hierarcy.png)
下面的示例代码是一个典型的应用服务:
````csharp
[Authorize("Author_Management")]
public class AuthorAppService : ApplicationService, IAuthorAppService
{
public Task<List<AuthorDto>> GetListAsync()
{
...
}
public Task<AuthorDto> GetAsync(Guid id)
{
...
}
[Authorize("Author_Management_Create_Books")]
public Task CreateAsync(CreateAuthorDto input)
{
...
}
[Authorize("Author_Management_Edit_Books")]
public Task UpdateAsync(CreateAuthorDto input)
{
...
}
[Authorize("Author_Management_Delete_Books")]
public Task DeleteAsync(CreateAuthorDto input)
{
...
}
}
````
* 拥有`Author_Management`权限的用户可以访问`GetListAsync`和 `GetAsync`方法.
* 示例中的其他方法需要额外的权限.
### 自定义策略覆盖已有权限
有时我们需要扩展扩展应用程序中预构建模块的权限,可以定义并注册一个与权限名称相同的策略到ASP.Net Core授权系统,策略会覆盖已有权限.
参阅 [基于策略的授权](https://docs.microsoft.com/zh-cn/aspnet/core/security/authorization/policies) 文档了解如何自定义策略.
## IAuthorizationService
ASP.NET Core 提供了 `IAuthorizationService` 用于检查权限. 注入后使用它进行条件控制权限.
示例:
````csharp
public async Task CreateAsync(CreateAuthorDto input)
{
var result = await AuthorizationService
.AuthorizeAsync("Author_Management_Create_Books");
if (result.Succeeded == false)
{
//throw exception
throw new AbpAuthorizationException("...");
}
//continue to the normal flow...
}
````
> 因为应用服务会经常检查权限,`ApplicationService` 已经属性注入了`AuthorizationService`, 所有继承自 `ApplicationService` 的类都可以直接使用. 你也可以直接 [注入](Dependency-Injection.md)到类中.
上面的示例代码是检查权限的标准代码,ABP提供了一种简化的方式来编写它.
示例:
````csharp
public async Task CreateAsync(CreateAuthorDto input)
{
await AuthorizationService.CheckAsync("Author_Management_Create_Books");
//continue to the normal flow...
}
````
如果未授权 `CheckAsync` 扩展方法会抛出 `AbpAuthorizationException` 异常. 还有一个 `IsGrantedAsync` 扩展方法会返回 `true` 或 `false`.
`IAuthorizationService` 中有多个 `AuthorizeAsync` 方法重载. [ASP.NET Core 授权文档](https://docs.microsoft.com/zh-cn/aspnet/core/security/authorization/introduction)中有详细的解释.
> 提示: 尽可能使用声明式的 `Authorize` attribute,因为它比较简单不会侵入方法内部. 如果你需要在业务代码中有条件的检查权限,那么请使用 `IAuthorizationService`.
### 在JavaScript中检查权限
有时你会需要在客户端检查策略/权限. 在ASP.NET Core MVC/Razor页面应用程序可以使用 `abp.auth` API. 示例:
````js
abp.auth.isGranted('MyPermissionName');
````
参阅 [abp.auth](AspNetCore/JavaScript-API/Auth.md) API 文档了解详情.
## 权限管理
通常权限管理是管理员用户使用权限管理模态框进行授权:
![authorization-new-permission-ui-localized](images/authorization-new-permission-ui-localized.png)
如果你想要通过代码管理权限, 可以注入使用 `IPermissionManager`. 如下所示:
````csharp
public class MyService : ITransientDependency
{
private readonly IPermissionManager _permissionManager;
public MyService(IPermissionManager permissionManager)
{
_permissionManager = permissionManager;
}
public async Task GrantPermissionForUserAsync(Guid userId, string permissionName)
{
await _permissionManager.SetForUserAsync(userId, permissionName, true);
}
public async Task ProhibitPermissionForUserAsync(Guid userId, string permissionName)
{
await _permissionManager.SetForUserAsync(userId, permissionName, false);
}
}
````
`SetForUserAsync` 方法用于设置用户的权限 (true/false). 类似的还有 `SetForRoleAsync` 和 `SetForClientAsync` 扩展方法.
`IPermissionManager` 由权限管理模块定义, 更多信息请参阅 [权限管理模块文档](Modules/Permission-Management.md).
## 高级主题
### Permission Value Providers
权限检查是可扩展的. 继承自 `PermissionValueProvider` (或实现 `IPermissionValueProvider`) 的任何类都可以参与权限检查. 有三个预定义的Provider:
* `UserPermissionValueProvider` 从当前的声明中拿到当前用户ID并检查用户授权. 用户声明由 `AbpClaimTypes.UserId` 静态属性定义.
* `RolePermissionValueProvider` 从当前的声明中拿到授予当前用户的角色集合并且判断角色是否具有指定的权限. 角色声明由 `AbpClaimTypes.Role` 静态属性定义.
* `ClientPermissionValueProvider` 从当前声明中拿到当前客户端并检查客户端是否具有指定的权限. 这在没有当前登录用户的客户端交互特别有用. 客户端声明由 `AbpClaimTypes.ClientId` 静态属性定义.
你可以定义自己的`PermissionValueProvider`扩展权限检查系统.
示例:
````csharp
public class SystemAdminPermissionValueProvider : PermissionValueProvider
{
public SystemAdminPermissionValueProvider(IPermissionStore permissionStore)
: base(permissionStore)
{
}
public override string Name => "SystemAdmin";
public override async Task<PermissionGrantResult>
CheckAsync(PermissionValueCheckContext context)
{
if (context.Principal?.FindFirst("User_Type")?.Value == "SystemAdmin")
{
return PermissionGrantResult.Granted;
}
return PermissionGrantResult.Undefined;
}
}
````
示例`SystemAdminPermissionValueProvider`允许声明`User_Type`值为`SystemAdmin`的用户授予所有权限. 通常在`Provider`中使用当前声明和 `IPermissionStore`.
`PermissionValueProvider` 的 `CheckAsync` 应该返回下面三个值之一:
* `PermissionGrantResult.Granted` 授予用户权限,如果没有其他的授权值提供程序返回 `Prohibited`, 那么最后会返回 `Granted`.
* `PermissionGrantResult.Prohibited` 禁止授权用户,任何一个授权值提供程序返回了 `Prohibited`, 那么其他的提供程序返回的值都不再重要.
* `PermissionGrantResult.Undefined` 代表当前无法确定是否授予或禁止权限, 返回`UnDefined`由其他权限值提供程序检查权限.
定义`Provider`后将其添加到 `PermissionOptions`,如下所示:
````csharp
Configure<PermissionOptions>(options =>
{
options.ValueProviders.Add<SystemAdminPermissionValueProvider>();
});
````
### Permission Store
`IPermissionStore` 是唯一需要从持久化源(通常是数据库)中读取权限值的接口. 它的实现在权限管理模块. 参见 [权限管理模块](Modules/Permission-Management.md) 了解更多信息
### AlwaysAllowAuthorizationService
`AlwaysAllowAuthorizationService` 类可以绕过授权服务. 通常用于在需要禁用授权系统的集成测试中.
使用 `IServiceCollection.AddAlwaysAllowAuthorization()` 扩展方法将 `AlwaysAllowAuthorizationService` 注册到 [依赖注入](Dependency-Injection.md) 系统中:
````csharp
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysAllowAuthorization();
}
````
启动模板的集成测试已经禁用了授权服务.
## 接下来
* [权限管理模块](Modules/Permission-Management.md)
* [ASP.NET Core MVC / Razor 页面 JavaScript Auth API](AspNetCore/JavaScript-API/Auth.md)

3
docs/zh-Hans/JavaScript/Dynamic-JavaScript-API-Clients.md

@ -0,0 +1,3 @@
## Dynamic JavaScript API Clients
TODO

3
docs/zh-Hans/Modules/Permission-Management.md

@ -0,0 +1,3 @@
# 权限管理模块
TODO

BIN
docs/zh-Hans/images/authorization-new-permission-ui-hierarcy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
docs/zh-Hans/images/authorization-new-permission-ui-localized.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
docs/zh-Hans/images/authorization-new-permission-ui.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
docs/zh-Hans/images/create-aspnet-core-application.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
docs/zh-Hans/images/create-new-aspnet-core-application-v2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
docs/zh-Hans/images/select-empty-web-application-v2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml

@ -14,7 +14,7 @@
@using Volo.Abp.MultiTenancy
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@inject IBrandingProvider BrandingProvider
@inject IOptions<MultiTenancyOptions> MultiTenancyOptions
@inject IOptions<AbpMultiTenancyOptions> MultiTenancyOptions
@inject ICurrentTenant CurrentTenant
@inject IStringLocalizer<AbpUiMultiTenancyResource> MultiTenancyStringLocalizer
@inject ITenantResolveResultAccessor TenantResolveResultAccessor

7
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs

@ -26,11 +26,8 @@ namespace Volo.Abp.AspNetCore.Mvc.Validation
return;
}
using (AbpCrossCuttingConcerns.Applying(context.Controller, AbpCrossCuttingConcerns.Validation))
{
_validator.Validate(context.ModelState);
await next();
}
_validator.Validate(context.ModelState);
await next();
}
}
}

13
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AuthorizationInterceptor.cs

@ -1,5 +1,4 @@
using System.Threading.Tasks;
using Volo.Abp.Aspects;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;
using Volo.Abp.Threading;
@ -17,24 +16,12 @@ namespace Volo.Abp.Authorization
public override void Intercept(IAbpMethodInvocation invocation)
{
if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.Authorization))
{
invocation.Proceed();
return;
}
AsyncHelper.RunSync(() => AuthorizeAsync(invocation));
invocation.Proceed();
}
public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{
if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.Authorization))
{
await invocation.ProceedAsync();
return;
}
await AuthorizeAsync(invocation);
await invocation.ProceedAsync();
}

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/ClientPermissionValueProvider.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Authorization.Permissions
{
public class ClientPermissionValueProvider : PermissionValueProvider
{
public const string ProviderName = "Client";
public const string ProviderName = "C";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs

@ -6,7 +6,7 @@ namespace Volo.Abp.Authorization.Permissions
{
public class RolePermissionValueProvider : PermissionValueProvider
{
public const string ProviderName = "Role";
public const string ProviderName = "R";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/UserPermissionValueProvider.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Authorization.Permissions
{
public class UserPermissionValueProvider : PermissionValueProvider
{
public const string ProviderName = "User";
public const string ProviderName = "U";
public override string Name => ProviderName;

1
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs

@ -21,6 +21,7 @@ namespace Volo.Abp.Caching
context.Services.AddDistributedMemoryCache();
context.Services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>));
context.Services.AddSingleton(typeof(IDistributedCache<,>), typeof(DistributedCache<,>));
context.Services.Configure<AbpDistributedCacheOptions>(cacheOptions =>
{

171
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs

@ -15,10 +15,36 @@ namespace Volo.Abp.Caching
/// Represents a distributed cache of <typeparamref name="TCacheItem" /> type.
/// </summary>
/// <typeparam name="TCacheItem">The type of cache item being cached.</typeparam>
public class DistributedCache<TCacheItem> : IDistributedCache<TCacheItem>
public class DistributedCache<TCacheItem> : DistributedCache<TCacheItem, string>, IDistributedCache<TCacheItem>
where TCacheItem : class
{
public ILogger<DistributedCache<TCacheItem>> Logger { get; set; }
public DistributedCache(
IOptions<CacheOptions> cacheOption,
IOptions<DistributedCacheOptions> distributedCacheOption,
IDistributedCache cache,
ICancellationTokenProvider cancellationTokenProvider,
IDistributedCacheSerializer serializer,
ICurrentTenant currentTenant) : base(
cacheOption: cacheOption,
distributedCacheOption: distributedCacheOption,
cache: cache,
cancellationTokenProvider: cancellationTokenProvider,
serializer: serializer,
currentTenant: currentTenant)
{
}
}
/// <summary>
/// Represents a distributed cache of <typeparamref name="TCacheItem" /> type.
/// Uses a generic cache key type of <typeparamref name="TCacheKey" /> type.
/// </summary>
/// <typeparam name="TCacheItem">The type of cache item being cached.</typeparam>
/// <typeparam name="TCacheKey">The type of cache key being used.</typeparam>
public class DistributedCache<TCacheItem, TCacheKey> : IDistributedCache<TCacheItem, TCacheKey>
where TCacheItem : class
{
public ILogger<DistributedCache<TCacheItem, TCacheKey>> Logger { get; set; }
protected string CacheName { get; set; }
@ -52,7 +78,7 @@ namespace Volo.Abp.Caching
_cacheOption = cacheOption.Value;
Cache = cache;
CancellationTokenProvider = cancellationTokenProvider;
Logger = NullLogger<DistributedCache<TCacheItem>>.Instance;
Logger = NullLogger<DistributedCache<TCacheItem, TCacheKey>>.Instance;
Serializer = serializer;
CurrentTenant = currentTenant;
@ -60,7 +86,41 @@ namespace Volo.Abp.Caching
SetDefaultOptions();
}
protected virtual string NormalizeKey(TCacheKey key)
{
var normalizedKey = "c:" + CacheName + ",k:" + _cacheOption.KeyPrefix + key.ToString();
if (!IgnoreMultiTenancy && CurrentTenant.Id.HasValue)
{
normalizedKey = "t:" + CurrentTenant.Id.Value + "," + normalizedKey;
}
return normalizedKey;
}
protected virtual DistributedCacheEntryOptions GetDefaultCacheEntryOptions()
{
foreach (var configure in _cacheOption.CacheConfigurators)
{
var options = configure.Invoke(CacheName);
if (options != null)
{
return options;
}
}
return _cacheOption.GlobalCacheEntryOptions;
}
protected virtual void SetDefaultOptions()
{
CacheName = CacheNameAttribute.GetCacheName(typeof(TCacheItem));
//IgnoreMultiTenancy
IgnoreMultiTenancy = typeof(TCacheItem).IsDefined(typeof(IgnoreMultiTenancyAttribute), true);
//Configure default cache entry options
DefaultCacheOptions = GetDefaultCacheEntryOptions();
}
/// <summary>
/// Gets a cache item with the given key. If no cache item is found for the given key then returns null.
/// </summary>
@ -68,7 +128,7 @@ namespace Volo.Abp.Caching
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
/// <returns>The cache item, or null.</returns>
public virtual TCacheItem Get(
string key,
TCacheKey key,
bool? hideErrors = null)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -106,8 +166,8 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The cache item, or null.</returns>
public virtual async Task<TCacheItem> GetAsync(
string key,
bool? hideErrors = null,
TCacheKey key,
bool? hideErrors = null,
CancellationToken token = default)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -131,7 +191,7 @@ namespace Volo.Abp.Caching
throw;
}
if (cachedBytes == null)
{
return null;
@ -139,7 +199,6 @@ namespace Volo.Abp.Caching
return Serializer.Deserialize<TCacheItem>(cachedBytes);
}
/// <summary>
/// Gets or Adds a cache item with the given key. If no cache item is found for the given key then adds a cache item
/// provided by <paramref name="factory" /> delegate and returns the provided cache item.
@ -149,10 +208,10 @@ namespace Volo.Abp.Caching
/// <param name="optionsFactory">The cache options for the factory delegate.</param>
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
/// <returns>The cache item.</returns>
public TCacheItem GetOrAdd(
string key,
Func<TCacheItem> factory,
Func<DistributedCacheEntryOptions> optionsFactory = null,
public virtual TCacheItem GetOrAdd(
TCacheKey key,
Func<TCacheItem> factory,
Func<DistributedCacheEntryOptions> optionsFactory = null,
bool? hideErrors = null)
{
var value = Get(key, hideErrors);
@ -175,7 +234,6 @@ namespace Volo.Abp.Caching
return value;
}
/// <summary>
/// Gets or Adds a cache item with the given key. If no cache item is found for the given key then adds a cache item
/// provided by <paramref name="factory" /> delegate and returns the provided cache item.
@ -186,11 +244,11 @@ namespace Volo.Abp.Caching
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The cache item.</returns>
public async Task<TCacheItem> GetOrAddAsync(
string key,
Func<Task<TCacheItem>> factory,
Func<DistributedCacheEntryOptions> optionsFactory = null,
bool? hideErrors = null,
public virtual async Task<TCacheItem> GetOrAddAsync(
TCacheKey key,
Func<Task<TCacheItem>> factory,
Func<DistributedCacheEntryOptions> optionsFactory = null,
bool? hideErrors = null,
CancellationToken token = default)
{
token = CancellationTokenProvider.FallbackToProvider(token);
@ -214,7 +272,6 @@ namespace Volo.Abp.Caching
return value;
}
/// <summary>
/// Sets the cache item value for the provided key.
/// </summary>
@ -223,9 +280,9 @@ namespace Volo.Abp.Caching
/// <param name="options">The cache options for the value.</param>
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
public virtual void Set(
string key,
TCacheItem value,
DistributedCacheEntryOptions options = null,
TCacheKey key,
TCacheItem value,
DistributedCacheEntryOptions options = null,
bool? hideErrors = null)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -249,7 +306,6 @@ namespace Volo.Abp.Caching
throw;
}
}
/// <summary>
/// Sets the cache item value for the provided key.
/// </summary>
@ -260,10 +316,10 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The <see cref="T:System.Threading.Tasks.Task" /> indicating that the operation is asynchronous.</returns>
public virtual async Task SetAsync(
string key,
TCacheItem value,
DistributedCacheEntryOptions options = null,
bool? hideErrors = null,
TCacheKey key,
TCacheItem value,
DistributedCacheEntryOptions options = null,
bool? hideErrors = null,
CancellationToken token = default)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -288,15 +344,14 @@ namespace Volo.Abp.Caching
throw;
}
}
/// <summary>
/// Refreshes the cache value of the given key, and resets its sliding expiration timeout.
/// </summary>
/// <param name="key">The key of cached item to be retrieved from the cache.</param>
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
public virtual void Refresh(
string key,
bool? hideErrors = null)
TCacheKey key, bool?
hideErrors = null)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -315,7 +370,6 @@ namespace Volo.Abp.Caching
throw;
}
}
/// <summary>
/// Refreshes the cache value of the given key, and resets its sliding expiration timeout.
/// </summary>
@ -324,8 +378,8 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The <see cref="T:System.Threading.Tasks.Task" /> indicating that the operation is asynchronous.</returns>
public virtual async Task RefreshAsync(
string key,
bool? hideErrors = null,
TCacheKey key,
bool? hideErrors = null,
CancellationToken token = default)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -345,15 +399,13 @@ namespace Volo.Abp.Caching
throw;
}
}
/// <summary>
/// Removes the cache item for given key from cache.
/// </summary>
/// <param name="key">The key of cached item to be retrieved from the cache.</param>
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
public virtual void Remove(
string key,
TCacheKey key,
bool? hideErrors = null)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -372,7 +424,6 @@ namespace Volo.Abp.Caching
throw;
}
}
/// <summary>
/// Removes the cache item for given key from cache.
/// </summary>
@ -381,8 +432,8 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The <see cref="T:System.Threading.Tasks.Task" /> indicating that the operation is asynchronous.</returns>
public virtual async Task RemoveAsync(
string key,
bool? hideErrors = null,
TCacheKey key,
bool? hideErrors = null,
CancellationToken token = default)
{
hideErrors = hideErrors ?? _distributedCacheOption.HideErrors;
@ -401,42 +452,8 @@ namespace Volo.Abp.Caching
throw;
}
}
protected virtual string NormalizeKey(string key)
{
var normalizedKey = "c:" + CacheName + ",k:" + _cacheOption.KeyPrefix + key;
if (!IgnoreMultiTenancy && CurrentTenant.Id.HasValue)
{
normalizedKey = "t:" + CurrentTenant.Id.Value + "," + normalizedKey;
}
return normalizedKey;
}
protected virtual DistributedCacheEntryOptions GetDefaultCacheEntryOptions()
{
foreach (var configure in _cacheOption.CacheConfigurators)
{
var options = configure.Invoke(CacheName);
if (options != null)
{
return options;
}
}
return _cacheOption.GlobalCacheEntryOptions;
}
protected virtual void SetDefaultOptions()
{
CacheName = CacheNameAttribute.GetCacheName(typeof(TCacheItem));
//IgnoreMultiTenancy
IgnoreMultiTenancy = typeof(TCacheItem).IsDefined(typeof(IgnoreMultiTenancyAttribute), true);
//Configure default cache entry options
DefaultCacheOptions = GetDefaultCacheEntryOptions();
}
}
}
}
}

33
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs

@ -10,7 +10,18 @@ namespace Volo.Abp.Caching
/// Represents a distributed cache of <typeparamref name="TCacheItem" /> type.
/// </summary>
/// <typeparam name="TCacheItem">The type of cache item being cached.</typeparam>
public interface IDistributedCache<TCacheItem>
public interface IDistributedCache<TCacheItem> : IDistributedCache<TCacheItem, string>
where TCacheItem : class
{
}
/// <summary>
/// Represents a distributed cache of <typeparamref name="TCacheItem" /> type.
/// Uses a generic cache key type of <typeparamref name="TCacheKey" /> type.
/// </summary>
/// <typeparam name="TCacheItem">The type of cache item being cached.</typeparam>
/// <typeparam name="TCacheKey">The type of cache key being used.</typeparam>
public interface IDistributedCache<TCacheItem, TCacheKey>
where TCacheItem : class
{
/// <summary>
@ -20,7 +31,7 @@ namespace Volo.Abp.Caching
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
/// <returns>The cache item, or null.</returns>
TCacheItem Get(
string key,
TCacheKey key,
bool? hideErrors = null
);
@ -32,7 +43,7 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The cache item, or null.</returns>
Task<TCacheItem> GetAsync(
[NotNull] string key,
[NotNull] TCacheKey key,
bool? hideErrors = null,
CancellationToken token = default
);
@ -47,7 +58,7 @@ namespace Volo.Abp.Caching
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
/// <returns>The cache item.</returns>
TCacheItem GetOrAdd(
string key,
TCacheKey key,
Func<TCacheItem> factory,
Func<DistributedCacheEntryOptions> optionsFactory = null,
bool? hideErrors = null
@ -64,7 +75,7 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The cache item.</returns>
Task<TCacheItem> GetOrAddAsync(
[NotNull] string key,
[NotNull] TCacheKey key,
Func<Task<TCacheItem>> factory,
Func<DistributedCacheEntryOptions> optionsFactory = null,
bool? hideErrors = null,
@ -79,7 +90,7 @@ namespace Volo.Abp.Caching
/// <param name="options">The cache options for the value.</param>
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
void Set(
string key,
TCacheKey key,
TCacheItem value,
DistributedCacheEntryOptions options = null,
bool? hideErrors = null
@ -95,7 +106,7 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The <see cref="T:System.Threading.Tasks.Task" /> indicating that the operation is asynchronous.</returns>
Task SetAsync(
[NotNull] string key,
[NotNull] TCacheKey key,
[NotNull] TCacheItem value,
[CanBeNull] DistributedCacheEntryOptions options = null,
bool? hideErrors = null,
@ -108,7 +119,7 @@ namespace Volo.Abp.Caching
/// <param name="key">The key of cached item to be retrieved from the cache.</param>
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
void Refresh(
string key,
TCacheKey key,
bool? hideErrors = null
);
@ -120,7 +131,7 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The <see cref="T:System.Threading.Tasks.Task" /> indicating that the operation is asynchronous.</returns>
Task RefreshAsync(
string key,
TCacheKey key,
bool? hideErrors = null,
CancellationToken token = default
);
@ -131,7 +142,7 @@ namespace Volo.Abp.Caching
/// <param name="key">The key of cached item to be retrieved from the cache.</param>
/// <param name="hideErrors">Indicates to throw or hide the exceptions for the distributed cache.</param>
void Remove(
string key,
TCacheKey key,
bool? hideErrors = null
);
@ -143,7 +154,7 @@ namespace Volo.Abp.Caching
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> for the task.</param>
/// <returns>The <see cref="T:System.Threading.Tasks.Task" /> indicating that the operation is asynchronous.</returns>
Task RemoveAsync(
string key,
TCacheKey key,
bool? hideErrors = null,
CancellationToken token = default
);

8
framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj

@ -15,10 +15,10 @@
<PackageReference Include="SharpZipLib" Version="1.2.0" />
<PackageReference Include="HtmlAgilityPack.NetCore" Version="1.5.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="NuGet.Versioning" Version="5.2.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.2.1" />
<PackageReference Include="NuGet.Versioning" Version="5.3.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0" />
<PackageReference Include="System.Security.Permissions" Version="4.6.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.3.1" />
</ItemGroup>
<ItemGroup>

4
framework/src/Volo.Abp.Cli/Volo.Abp.Cli.csproj

@ -12,8 +12,8 @@
<ItemGroup>
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.4" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
</ItemGroup>

2
framework/src/Volo.Abp.Core/Volo/Abp/Aspects/AbpCrossCuttingConcerns.cs

@ -9,9 +9,7 @@ namespace Volo.Abp.Aspects
//TODO: Move these constants to their own assemblies!
public const string Auditing = "AbpAuditing";
public const string Validation = "AbpValidation";
public const string UnitOfWork = "AbpUnitOfWork";
public const string Authorization = "AbpAuthorization";
public const string FeatureChecking = "AbpFeatureChecking";
public static void AddApplied(object obj, params string[] concerns)

2
framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="1.60.6" />
<PackageReference Include="Dapper" Version="2.0.30" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.Features/Volo/Abp/Features/DefaultValueSettingValueProvider.cs

@ -4,7 +4,7 @@ namespace Volo.Abp.Features
{
public class DefaultValueFeatureValueProvider : FeatureValueProvider //TODO: Directly implement IFeatureValueProvider
{
public const string ProviderName = "Default";
public const string ProviderName = "D";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs

@ -6,7 +6,7 @@ namespace Volo.Abp.Features
{
public class EditionFeatureValueProvider : FeatureValueProvider
{
public const string ProviderName = "Edition";
public const string ProviderName = "E";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.Features/Volo/Abp/Features/TenantFeatureValueProvider.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Features
{
public class TenantFeatureValueProvider : FeatureValueProvider
{
public const string ProviderName = "Tenant";
public const string ProviderName = "T";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj

@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentValidation" Version="8.4.0" />
<PackageReference Include="FluentValidation" Version="8.5.0" />
</ItemGroup>
<ItemGroup>

2
framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj

@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="2.3.0" />
<PackageReference Include="MailKit" Version="2.3.2" />
</ItemGroup>
<ItemGroup>

2
framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj

@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.9.1" />
<PackageReference Include="MongoDB.Driver" Version="2.9.2" />
</ItemGroup>
<ItemGroup>

2
framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj

@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RabbitMQ.Client" Version="5.1.0" />
<PackageReference Include="RabbitMQ.Client" Version="5.1.2" />
<ProjectReference Include="..\Volo.Abp.Json\Volo.Abp.Json.csproj" />
<ProjectReference Include="..\Volo.Abp.Threading\Volo.Abp.Threading.csproj" />
</ItemGroup>

2
framework/src/Volo.Abp.Settings/Volo/Abp/Settings/DefaultValueSettingValueProvider.cs

@ -4,7 +4,7 @@ namespace Volo.Abp.Settings
{
public class DefaultValueSettingValueProvider : SettingValueProvider
{
public const string ProviderName = "Default";
public const string ProviderName = "D";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.Settings/Volo/Abp/Settings/GlobalSettingValueProvider.cs

@ -4,7 +4,7 @@ namespace Volo.Abp.Settings
{
public class GlobalSettingValueProvider : SettingValueProvider
{
public const string ProviderName = "Global";
public const string ProviderName = "G";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.Settings/Volo/Abp/Settings/TenantSettingValueProvider.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Settings
{
public class TenantSettingValueProvider : SettingValueProvider
{
public const string ProviderName = "Tenant";
public const string ProviderName = "T";
public override string Name => ProviderName;

2
framework/src/Volo.Abp.Settings/Volo/Abp/Settings/UserSettingValueProvider.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Settings
{
public class UserSettingValueProvider : SettingValueProvider
{
public const string ProviderName = "User";
public const string ProviderName = "U";
public override string Name => ProviderName;

8
framework/src/Volo.Abp.Validation/Volo/Abp/Validation/MethodInvocationValidator.cs

@ -96,7 +96,13 @@ namespace Volo.Abp.Validation
parameterInfo.IsOut ||
TypeHelper.IsPrimitiveExtended(parameterInfo.ParameterType, includeEnums: true);
context.Errors.AddRange(_objectValidator.GetErrors(parameterValue, parameterInfo.Name, allowNulls));
context.Errors.AddRange(
_objectValidator.GetErrors(
parameterValue,
parameterInfo.Name,
allowNulls
)
);
}
}
}

3
framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ObjectValidator.cs

@ -56,7 +56,8 @@ namespace Volo.Abp.Validation
{
foreach (var contributorType in Options.ObjectValidationContributors)
{
var contributor = (IObjectValidationContributor) scope.ServiceProvider.GetRequiredService(contributorType);
var contributor = (IObjectValidationContributor)
scope.ServiceProvider.GetRequiredService(contributorType);
contributor.AddErrors(context);
}
}

15
framework/src/Volo.Abp.Validation/Volo/Abp/Validation/ValidationInterceptor.cs

@ -1,5 +1,4 @@
using System.Threading.Tasks;
using Volo.Abp.Aspects;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;
@ -16,27 +15,13 @@ namespace Volo.Abp.Validation
public override void Intercept(IAbpMethodInvocation invocation)
{
if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.Validation))
{
invocation.Proceed();
return;
}
Validate(invocation);
invocation.Proceed();
}
public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{
if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.Validation))
{
await invocation.ProceedAsync();
return;
}
Validate(invocation);
await invocation.ProceedAsync();
}

2
framework/test/AbpTestBase/AbpTestBase.csproj

@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="xunit" Version="2.4.1" />

2
framework/test/Volo.Abp.AspNetCore.Authentication.OAuth.Tests/Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj

@ -17,7 +17,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.AspNetCore.Authentication.OAuth\Volo.Abp.AspNetCore.Authentication.OAuth.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo.Abp.AspNetCore.MultiTenancy.Tests.csproj

@ -12,7 +12,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Tests\Volo.Abp.AspNetCore.Tests.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo.Abp.AspNetCore.Mvc.Tests.csproj

@ -20,7 +20,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
<ItemGroup>

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests.csproj

@ -19,7 +19,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Tests\Volo.Abp.AspNetCore.Tests.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
<!-- Below ItemGroup and Target tags are added according to https://github.com/aspnet/Hosting/issues/959#issuecomment-286351703 -->

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
</ItemGroup>
<ItemGroup>

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo.Abp.AspNetCore.Mvc.UI.Tests.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
<ItemGroup>

2
framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
<ItemGroup>

2
framework/test/Volo.Abp.AspNetCore.Tests/Volo.Abp.AspNetCore.Tests.csproj

@ -25,7 +25,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.AspNetCore.TestBase\Volo.Abp.AspNetCore.TestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Auditing.Tests/Volo.Abp.Auditing.Tests.csproj

@ -14,7 +14,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Auditing\Volo.Abp.Auditing.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Authorization.Tests/Volo.Abp.Authorization.Tests.csproj

@ -14,7 +14,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Authorization\Volo.Abp.Authorization.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.AutoMapper.Tests/Volo.Abp.AutoMapper.Tests.csproj

@ -12,7 +12,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Autofac.Tests/Volo.Abp.Autofac.Tests.csproj

@ -14,7 +14,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\Volo.Abp.Core.Tests\Volo.Abp.Core.Tests.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.BackgroundJobs.Tests/Volo.Abp.BackgroundJobs.Tests.csproj

@ -13,7 +13,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.BackgroundJobs\Volo.Abp.BackgroundJobs.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Caching.Tests/Volo.Abp.Caching.Tests.csproj

@ -12,7 +12,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Caching\Volo.Abp.Caching.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

187
framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs

@ -122,5 +122,192 @@ namespace Volo.Abp.Caching
cacheItem1.ShouldNotBeNull();
}
[Fact]
public async Task Should_Set_Get_And_Remove_Cache_Items_With_Integer_Type_CacheKey()
{
var personCache = GetRequiredService<IDistributedCache<PersonCacheItem, int>>();
var cacheKey = 42;
const string personName = "john nash";
//Get (not exists yet)
var cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldBeNull();
//Set
cacheItem = new PersonCacheItem(personName);
await personCache.SetAsync(cacheKey, cacheItem);
//Get (it should be available now
cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldNotBeNull();
cacheItem.Name.ShouldBe(personName);
//Remove
await personCache.RemoveAsync(cacheKey);
//Get (not exists since removed)
cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldBeNull();
}
[Fact]
public async Task GetOrAddAsync_With_Integer_Type_CacheKey()
{
var personCache = GetRequiredService<IDistributedCache<PersonCacheItem, int>>();
var cacheKey = 42;
const string personName = "john nash";
//Will execute the factory method to create the cache item
bool factoryExecuted = false;
var cacheItem = await personCache.GetOrAddAsync(cacheKey,
async () =>
{
factoryExecuted = true;
return new PersonCacheItem(personName);
});
factoryExecuted.ShouldBeTrue();
cacheItem.Name.ShouldBe(personName);
//This time, it will not execute the factory
factoryExecuted = false;
cacheItem = await personCache.GetOrAddAsync(cacheKey,
async () =>
{
factoryExecuted = true;
return new PersonCacheItem(personName);
});
factoryExecuted.ShouldBeFalse();
cacheItem.Name.ShouldBe(personName);
}
[Fact]
public async Task SameClassName_But_DiffNamespace_Should_Not_Use_Same_Cache_With_Integer_CacheKey()
{
var personCache = GetRequiredService<IDistributedCache<PersonCacheItem, int>>();
var otherPersonCache = GetRequiredService<IDistributedCache<Sail.Testing.Caching.PersonCacheItem, int>>();
var cacheKey = 42;
const string personName = "john nash";
//Get (not exists yet)
var cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldBeNull();
var cacheItem1 = await otherPersonCache.GetAsync(cacheKey);
cacheItem1.ShouldBeNull();
//Set
cacheItem = new PersonCacheItem(personName);
await personCache.SetAsync(cacheKey, cacheItem);
//Get (it should be available now, but otherPersonCache not exists now.
cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldNotBeNull();
cacheItem.Name.ShouldBe(personName);
cacheItem1 = await otherPersonCache.GetAsync(cacheKey);
cacheItem1.ShouldBeNull();
//set other person cache
cacheItem1 = new Sail.Testing.Caching.PersonCacheItem(personName);
await otherPersonCache.SetAsync(cacheKey, cacheItem1);
cacheItem1 = await otherPersonCache.GetAsync(cacheKey);
cacheItem1.ShouldNotBeNull();
cacheItem1.Name.ShouldBe(personName);
//Remove
await personCache.RemoveAsync(cacheKey);
//Get (not exists since removed)
cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldBeNull();
cacheItem1 = await otherPersonCache.GetAsync(cacheKey);
cacheItem1.ShouldNotBeNull();
}
[Fact]
public async Task Should_Set_Get_And_Remove_Cache_Items_With_Object_Type_CacheKey()
{
var personCache = GetRequiredService<IDistributedCache<PersonCacheItem, ComplexObjectAsCacheKey>>();
var cacheKey = new ComplexObjectAsCacheKey { Name = "DummyData", Age = 42 };
const string personName = "john nash";
//Get (not exists yet)
var cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldBeNull();
//Set
cacheItem = new PersonCacheItem(personName);
await personCache.SetAsync(cacheKey, cacheItem);
//Get (it should be available now
cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldNotBeNull();
cacheItem.Name.ShouldBe(personName);
//Remove
await personCache.RemoveAsync(cacheKey);
//Get (not exists since removed)
cacheItem = await personCache.GetAsync(cacheKey);
cacheItem.ShouldBeNull();
}
[Fact]
public async Task Should_Set_Get_And_Remove_Cache_Items_For_Same_Object_Type_With_Different_CacheKeys()
{
var personCache = GetRequiredService<IDistributedCache<PersonCacheItem, ComplexObjectAsCacheKey>>();
var cache1Key = new ComplexObjectAsCacheKey { Name = "John", Age = 42 };
var cache2Key = new ComplexObjectAsCacheKey { Name = "Jenny", Age = 24 };
const string personName = "john nash";
//Get (not exists yet)
var cacheItem1 = await personCache.GetAsync(cache1Key);
var cacheItem2 = await personCache.GetAsync(cache2Key);
cacheItem1.ShouldBeNull();
cacheItem2.ShouldBeNull();
//Set
cacheItem1 = new PersonCacheItem(personName);
cacheItem2 = new PersonCacheItem(personName);
await personCache.SetAsync(cache1Key, cacheItem1);
await personCache.SetAsync(cache2Key, cacheItem2);
//Get (it should be available now
cacheItem1 = await personCache.GetAsync(cache1Key);
cacheItem1.ShouldNotBeNull();
cacheItem1.Name.ShouldBe(personName);
cacheItem2 = await personCache.GetAsync(cache2Key);
cacheItem2.ShouldNotBeNull();
cacheItem2.Name.ShouldBe(personName);
//Remove
await personCache.RemoveAsync(cache1Key);
await personCache.RemoveAsync(cache2Key);
//Get (not exists since removed)
cacheItem1 = await personCache.GetAsync(cache1Key);
cacheItem1.ShouldBeNull();
cacheItem2 = await personCache.GetAsync(cache2Key);
cacheItem2.ShouldBeNull();
}
}
}

29
framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/PersonCacheItem.cs

@ -1,5 +1,6 @@
using System;
using System.Linq;
namespace Volo.Abp.Caching
{
[Serializable]
@ -17,7 +18,33 @@ namespace Volo.Abp.Caching
Name = name;
}
}
public class ComplexObjectAsCacheKey
{
public string Name { get; set; }
public int Age { get; set; }
public override string ToString()
{
// Return selective fields
//return $"{Name}_{Age}";
// Return all the fields concatenated
var sb = new System.Text.StringBuilder();
var properties = this.GetType().GetProperties()
.Where(prop => prop.CanRead && prop.CanWrite);
foreach (var prop in properties)
{
var value = prop.GetValue(this, null);
if (value != null)
{
sb.Append(value.ToString());
}
}
return sb.ToString();
}
}
}
namespace Sail.Testing.Caching
{
[Serializable]

2
framework/test/Volo.Abp.Castle.Core.Tests/Volo.Abp.Castle.Core.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.Castle.Core\Volo.Abp.Castle.Core.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Cli.Core.Tests/Volo.Abp.Cli.Core.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Cli.Core\Volo.Abp.Cli.Core.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Core.Tests/Volo.Abp.Core.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Core\Volo.Abp.Core.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Dapper.Tests/Volo.Abp.Dapper.Tests.csproj

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0" />
</ItemGroup>

2
framework/test/Volo.Abp.Data.Tests/Volo.Abp.Data.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Data\Volo.Abp.Data.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Ddd.Tests/Volo.Abp.Ddd.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.Ddd.Domain\Volo.Abp.Ddd.Domain.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Emailing.Tests/Volo.Abp.Emailing.Tests.csproj

@ -18,7 +18,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Emailing\Volo.Abp.Emailing.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo.Abp.EntityFrameworkCore.Tests.csproj

@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.EventBus.Tests/Volo.Abp.EventBus.Tests.csproj

@ -12,7 +12,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Ddd.Domain\Volo.Abp.Ddd.Domain.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.EventBus\Volo.Abp.EventBus.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Features.Tests/Volo.Abp.Features.Tests.csproj

@ -11,7 +11,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Features\Volo.Abp.Features.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.FluentValidation.Tests/Volo.Abp.FluentValidation.Tests.csproj

@ -11,7 +11,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.FluentValidation\Volo.Abp.FluentValidation.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Http.Client.Tests/Volo.Abp.Http.Client.Tests.csproj

@ -11,7 +11,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Http.Client\Volo.Abp.Http.Client.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.Tests\Volo.Abp.AspNetCore.Mvc.Tests.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Ldap.Tests/Volo.Abp.Ldap.Tests.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
<ItemGroup>

2
framework/test/Volo.Abp.Localization.Tests/Volo.Abp.Localization.Tests.csproj

@ -14,7 +14,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.MailKit.Tests/Volo.Abp.MailKit.Tests.csproj

@ -11,7 +11,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.MailKit\Volo.Abp.MailKit.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.MemoryDb.Tests/Volo.Abp.MemoryDb.Tests.csproj

@ -12,7 +12,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.MemoryDb\Volo.Abp.MemoryDb.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\Volo.Abp.TestApp\Volo.Abp.TestApp.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

4
framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj

@ -15,8 +15,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mongo2Go" Version="2.2.11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Mongo2Go" Version="2.2.12" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.MultiTenancy.Tests/Volo.Abp.MultiTenancy.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.MultiTenancy\Volo.Abp.MultiTenancy.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.ObjectMapping.Tests/Volo.Abp.ObjectMapping.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.ObjectMapping\Volo.Abp.ObjectMapping.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Security.Tests/Volo.Abp.Security.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.Security\Volo.Abp.Security.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Serialization.Tests/Volo.Abp.Serialization.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Serialization\Volo.Abp.Serialization.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj

@ -11,7 +11,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Settings\Volo.Abp.Settings.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Specifications.Tests/Volo.Abp.Specifications.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Specifications\Volo.Abp.Specifications.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.TestApp.Tests/Volo.Abp.TestApp.Tests.csproj

@ -9,7 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.MemoryDb.Tests\Volo.Abp.MemoryDb.Tests.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj

@ -14,7 +14,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.TestBase\Volo.Abp.TestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Specifications\Volo.Abp.Specifications.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.UI.Navigation.Tests/Volo.Abp.UI.Navigation.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.UI.Navigation\Volo.Abp.UI.Navigation.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Uow\Volo.Abp.Uow.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj

@ -11,7 +11,7 @@
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Validation\Volo.Abp.Validation.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj

@ -14,7 +14,7 @@
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

2
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/DemoAppModule.cs

@ -11,7 +11,7 @@ namespace Volo.Abp.BackgroundJobs.DemoApp
{
[DependsOn(
typeof(DemoAppSharedModule),
typeof(BackgroundJobsEntityFrameworkCoreModule),
typeof(AbpBackgroundJobsEntityFrameworkCoreModule),
typeof(AbpAutofacModule),
typeof(AbpEntityFrameworkCoreSqlServerModule)
)]

2
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo/Abp/BackgroundJobs/BackgroundJobsDomainSharedModule.cs → modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDomainSharedModule.cs

@ -2,7 +2,7 @@
namespace Volo.Abp.BackgroundJobs
{
public class BackgroundJobsDomainSharedModule : AbpModule
public class AbpBackgroundJobsDomainSharedModule : AbpModule
{
}

6
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDomainModule.cs → modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDomainModule.cs

@ -5,15 +5,15 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.BackgroundJobs
{
[DependsOn(
typeof(BackgroundJobsDomainSharedModule),
typeof(AbpBackgroundJobsDomainSharedModule),
typeof(AbpBackgroundJobsModule),
typeof(AbpAutoMapperModule)
)]
public class BackgroundJobsDomainModule : AbpModule //TODO: Rename to AbpBackgroundJobsDomainModule
public class AbpBackgroundJobsDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<BackgroundJobsDomainModule>();
context.Services.AddAutoMapperObjectMapper<AbpBackgroundJobsDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<BackgroundJobsDomainAutoMapperProfile>(validate: true);

4
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs

@ -10,11 +10,11 @@ namespace Volo.Abp.BackgroundJobs
{
protected IBackgroundJobRepository BackgroundJobRepository { get; }
protected IObjectMapper<BackgroundJobsDomainModule> ObjectMapper { get; }
protected IObjectMapper<AbpBackgroundJobsDomainModule> ObjectMapper { get; }
public BackgroundJobStore(
IBackgroundJobRepository backgroundJobRepository,
IObjectMapper<BackgroundJobsDomainModule> objectMapper)
IObjectMapper<AbpBackgroundJobsDomainModule> objectMapper)
{
ObjectMapper = objectMapper;
BackgroundJobRepository = backgroundJobRepository;

4
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsEntityFrameworkCoreModule.cs → modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreModule.cs

@ -5,10 +5,10 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{
[DependsOn(
typeof(BackgroundJobsDomainModule),
typeof(AbpBackgroundJobsDomainModule),
typeof(AbpEntityFrameworkCoreModule)
)]
public class BackgroundJobsEntityFrameworkCoreModule : AbpModule
public class AbpBackgroundJobsEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

4
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbModule.cs → modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbModule.cs

@ -5,10 +5,10 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.BackgroundJobs.MongoDB
{
[DependsOn(
typeof(BackgroundJobsDomainModule),
typeof(AbpBackgroundJobsDomainModule),
typeof(AbpMongoDbModule)
)]
public class BackgroundJobsMongoDbModule : AbpModule
public class AbpBackgroundJobsMongoDbModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

4
modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo/Abp/BackgroundJobs/BackgroundJobsDomainTestModule.cs → modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDomainTestModule.cs

@ -4,9 +4,9 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.BackgroundJobs
{
[DependsOn(
typeof(BackgroundJobsEntityFrameworkCoreTestModule)
typeof(AbpBackgroundJobsEntityFrameworkCoreTestModule)
)]
public class BackgroundJobsDomainTestModule : AbpModule
public class AbpBackgroundJobsDomainTestModule : AbpModule
{
}

2
modules/background-jobs/test/Volo.Abp.BackgroundJobs.Domain.Tests/Volo/Abp/BackgroundJobs/BackgroundJobsDomainTestBase.cs

@ -1,6 +1,6 @@
namespace Volo.Abp.BackgroundJobs
{
public abstract class BackgroundJobsDomainTestBase : BackgroundJobsTestBase<BackgroundJobsDomainTestModule>
public abstract class BackgroundJobsDomainTestBase : BackgroundJobsTestBase<AbpBackgroundJobsDomainTestModule>
{
}

6
modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsEntityFrameworkCoreTestModule.cs → modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreTestModule.cs

@ -9,10 +9,10 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{
[DependsOn(
typeof(BackgroundJobsTestBaseModule),
typeof(BackgroundJobsEntityFrameworkCoreModule)
typeof(AbpBackgroundJobsTestBaseModule),
typeof(AbpBackgroundJobsEntityFrameworkCoreModule)
)]
public class BackgroundJobsEntityFrameworkCoreTestModule : AbpModule
public class AbpBackgroundJobsEntityFrameworkCoreTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

2
modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobRepositoryTests.cs

@ -1,6 +1,6 @@
namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{
public class BackgroundJobRepositoryTests : BackgroundJobRepository_Tests<BackgroundJobsEntityFrameworkCoreTestModule>
public class BackgroundJobRepositoryTests : BackgroundJobRepository_Tests<AbpBackgroundJobsEntityFrameworkCoreTestModule>
{
}

6
modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbTestModule.cs → modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs

@ -7,10 +7,10 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.BackgroundJobs.MongoDB
{
[DependsOn(
typeof(BackgroundJobsTestBaseModule),
typeof(BackgroundJobsMongoDbModule)
typeof(AbpBackgroundJobsTestBaseModule),
typeof(AbpBackgroundJobsMongoDbModule)
)]
public class BackgroundJobsMongoDbTestModule : AbpModule
public class AbpBackgroundJobsMongoDbTestModule : AbpModule
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();

2
modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobRepositoryTests.cs

@ -1,6 +1,6 @@
namespace Volo.Abp.BackgroundJobs.MongoDB
{
public class BackgroundJobRepositoryTests : BackgroundJobRepository_Tests<BackgroundJobsMongoDbTestModule>
public class BackgroundJobRepositoryTests : BackgroundJobRepository_Tests<AbpBackgroundJobsMongoDbTestModule>
{
}

4
modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/BackgroundJobsTestBaseModule.cs → modules/background-jobs/test/Volo.Abp.BackgroundJobs.TestBase/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestBaseModule.cs

@ -7,9 +7,9 @@ namespace Volo.Abp.BackgroundJobs
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpTestBaseModule),
typeof(BackgroundJobsDomainModule)
typeof(AbpBackgroundJobsDomainModule)
)]
public class BackgroundJobsTestBaseModule : AbpModule
public class AbpBackgroundJobsTestBaseModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

2
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js

@ -37,7 +37,7 @@
visible: abp.auth.isGranted('AbpIdentity.Roles.ManagePermissions'),
action: function (data) {
_permissionsModal.open({
providerName: 'Role',
providerName: 'R',
providerKey: data.record.name
});
}

2
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js

@ -36,7 +36,7 @@
visible: abp.auth.isGranted('AbpIdentity.Users.ManagePermissions'),
action: function (data) {
_permissionsModal.open({
providerName: 'User',
providerName: 'U',
providerKey: data.record.id
});
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save