Browse Source

Merge branch 'dev' into feat/build-command

pull/5418/head
İsmail ÇAĞDAŞ 6 years ago
parent
commit
0e1c90d3fa
  1. 2
      docs/en/CLI.md
  2. 2
      docs/zh-Hans/CLI.md
  3. 30
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor
  4. 18
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs
  5. 8
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/IUiMessageService.cs
  6. 22
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageService.cs
  7. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  8. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs
  9. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/UiFramework.cs
  10. 3
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/UiFrameworkExtensions.cs
  11. 30
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs
  12. 39
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/BlazorAppsettingsFilePortChangeForSeparatedIdentityServersStep.cs
  13. 2
      framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj
  14. 102
      framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
  15. 14
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbContext.cs
  16. 13
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs
  17. 27
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DependencyInjection/AbpMongoDbConventionalRegistrar.cs
  18. 4
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/IAbpMongoDbContext.cs
  19. 19
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoModelBuilder.cs
  20. 6
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoModelSource.cs
  21. 42
      framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/MongoDbTransactionApi.cs
  22. 63
      framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs
  23. 12
      framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs
  24. 7
      modules/account/Volo.Abp.Account.sln
  25. 20
      modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorAutoMapperProfile.cs
  26. 37
      modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorModule.cs
  27. 23
      modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorUserMenuContributor.cs
  28. 3
      modules/account/src/Volo.Abp.Account.Blazor/FodyWeavers.xml
  29. 30
      modules/account/src/Volo.Abp.Account.Blazor/FodyWeavers.xsd
  30. 64
      modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor
  31. 117
      modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor.cs
  32. 27
      modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj
  33. 5
      modules/account/src/Volo.Abp.Account.Blazor/_Imports.razor
  34. 12
      modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs
  35. 12
      modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs
  36. 14
      modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs
  37. 12
      modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs
  38. 14
      modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/CmsKitMongoDbTestModule.cs
  39. 10
      modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/DocsMongoDBTestModule.cs
  40. 6
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/AbpFeatureManagementDomainSharedModule.cs
  41. 6
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/FeatureManagementDomainErrorCodes.cs
  42. 14
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/FeatureValueInvalidException.cs
  43. 5
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/ar.json
  44. 5
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/de.json
  45. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/en.json
  46. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/ru.json
  47. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/tr.json
  48. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/zh-Hans.json
  49. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/zh-Hant.json
  50. 17
      modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManager.cs
  51. 83
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml
  52. 75
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js
  53. 12
      modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/AbpFeatureManagementMongoDbTestModule.cs
  54. 8
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor
  55. 4
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor
  56. 12
      modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs
  57. 8
      modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/AbpIdentityServerMongoDbTestModule.cs
  58. 12
      modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs
  59. 10
      modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs
  60. 10
      modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs
  61. 2
      modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs
  62. 1
      npm/ng-packs/package.json
  63. 20
      npm/ng-packs/packages/components/tree/src/lib/utils/nz-tree-adapter.ts
  64. 2
      npm/ng-packs/packages/core/src/lib/models/rest.ts
  65. 13
      npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.html
  66. 14
      npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts
  67. 4
      npm/ng-packs/packages/schematics/src/commands/api/files-service/proxy/__namespace@dir__/__name@kebab__.service.ts.template
  68. 99
      npm/ng-packs/yarn.lock
  69. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj
  70. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs
  71. 5
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameMenuContributor.cs
  72. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj
  73. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/Program.cs
  74. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
  75. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs
  76. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj
  77. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs
  78. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
  79. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs
  80. 46
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MongoDbMyProjectNameDbSchemaMigrator.cs
  81. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj
  82. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs
  83. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
  84. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs
  85. 8
      templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbTestModule.cs
  86. 2
      templates/console/src/MyCompanyName.MyProjectName/Program.cs
  87. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
  88. 5
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs
  89. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
  90. 5
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs
  91. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj
  92. 5
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs
  93. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj
  94. 5
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs
  95. 12
      templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MyProjectNameMongoDbTestModule.cs

2
docs/en/CLI.md

@ -87,6 +87,8 @@ abp new Acme.BookStore
* `--tiered`: Creates a tiered solution where Web and Http API layers are physically separated. If not specified, it creates a layered solution which is less complex and suitable for most scenarios.
* `angular`: Angular. There are some additional options for this template:
* `--separate-identity-server`: Separates the identity server application from the API host application. If not specified, you will have a single endpoint in the server side.
* `blazor`: Blazor. There are some additional options for this template:
* `--separate-identity-server`: Separates the identity server application from the API host application. If not specified, you will have a single endpoint in the server side.
* `none`: Without UI. There are some additional options for this template:
* `--separate-identity-server`: Separates the identity server application from the API host application. If not specified, you will have a single endpoint in the server side.
* `--mobile` or `-m`: Specifies the mobile application framework. If not specified, no mobile application will be created. Available options:

2
docs/zh-Hans/CLI.md

@ -85,6 +85,8 @@ abp new Acme.BookStore
* `--tiered`: 创建分层解决方案,Web和Http Api层在物理上是分开的.如果未指定会创建一个分层的解决方案,此解决方案没有那么复杂,适合大多数场景.
* `angular`: Angular. 这个模板还有一些额外的选项:
* `--separate-identity-server`: 将Identity Server应用程序与API host应用程序分开. 如果未指定,则服务器端将只有一个端点.
* `blazor`: Blazor. 这个模板还有一些额外的选项:
* `--separate-identity-server`: 将Identity Server应用程序与API host应用程序分开. 如果未指定,则服务器端将只有一个端点.
* `none`: 无UI. 这个模板还有一些额外的选项:
* `--separate-identity-server`: 将Identity Server应用程序与API host应用程序分开. 如果未指定,则服务器端将只有一个端点.
* `--mobile` 或者 `-m`: 指定移动应用程序框架. 如果未指定,则不会创建任何移动应用程序,其他选项:

30
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor

@ -6,22 +6,36 @@
<AuthorizeView>
<Authorized>
<Dropdown>
<DropdownToggle Color="Color.None">
@CurrentUser.UserName
</DropdownToggle>
<DropdownMenu>
<DropdownItem Clicked="BeginSignOut">Logout</DropdownItem>
</DropdownMenu>
</Dropdown>
<DropdownToggle Color="Color.None">
@CurrentUser.UserName
</DropdownToggle>
<DropdownMenu>
@if (Menu != null)
{
@foreach (var menuItem in Menu.Items)
{
<DropdownItem Clicked="@(() => NavigateTo(menuItem.Url))">@menuItem.DisplayName</DropdownItem>
}
}
<Divider />
<DropdownItem Clicked="BeginSignOut">Logout</DropdownItem>
</DropdownMenu>
</Dropdown>
</Authorized>
<NotAuthorized>
<a class="nav-link" href="authentication/login">Log in</a>
</NotAuthorized>
</AuthorizeView>
@code{
private void NavigateTo(string uri)
{
Navigation.NavigateTo(uri);
}
private async Task BeginSignOut()
{
await SignOutManager.SetSignOutState();
Navigation.NavigateTo("authentication/logout");
NavigateTo("authentication/logout");
}
}

18
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs

@ -0,0 +1,18 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic
{
public partial class LoginDisplay
{
[Inject] protected IMenuManager MenuManager { get; set; }
protected ApplicationMenu Menu { get; set; }
protected override async Task OnInitializedAsync()
{
Menu = await MenuManager.GetAsync(StandardMenus.User);
}
}
}

8
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/IUiMessageService.cs

@ -4,6 +4,14 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
public interface IUiMessageService
{
Task InfoAsync(string message, string title = null);
Task SuccessAsync(string message, string title = null);
Task WarnAsync(string message, string title = null);
Task ErrorAsync(string message, string title = null);
Task<bool> ConfirmAsync(string message, string title = null);
}
}

22
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/UiMessageService.cs

@ -4,6 +4,7 @@ using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly
{
//TODO: Implement with sweetalert in a new package
public class UiMessageService : IUiMessageService, ITransientDependency
{
protected IJSRuntime JsRuntime { get; }
@ -13,9 +14,28 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly
JsRuntime = jsRuntime;
}
public async Task InfoAsync(string message, string title = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task SuccessAsync(string message, string title = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task WarnAsync(string message, string title = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task ErrorAsync(string message, string title = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task<bool> ConfirmAsync(string message, string title = null)
{
//TODO: Implement with sweetalert in a new package
return await JsRuntime.InvokeAsync<bool>("confirm", message);
}
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -286,6 +286,8 @@ namespace Volo.Abp.Cli.Commands
return UiFramework.Mvc;
case "angular":
return UiFramework.Angular;
case "blazor":
return UiFramework.Blazor;
default:
return UiFramework.NotSpecified;
}

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/TemplateProjectBuildPipelineBuilder.cs

@ -19,13 +19,14 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building
pipeline.Steps.Add(new TemplateCodeDeleteStep());
pipeline.Steps.Add(new SolutionRenameStep());
if (context.Template.Name == AppProTemplate.TemplateName ||
if (context.Template.Name == AppProTemplate.TemplateName ||
context.Template.Name == ModuleProTemplate.TemplateName)
{
pipeline.Steps.Add(new LicenseCodeReplaceStep());
}
if (context.BuildArgs.UiFramework == UiFramework.Mvc && context.BuildArgs.MobileApp == MobileApp.None)
if ((context.BuildArgs.UiFramework == UiFramework.Mvc || context.BuildArgs.UiFramework == UiFramework.Blazor)
&& context.BuildArgs.MobileApp == MobileApp.None)
{
pipeline.Steps.Add(new RemoveRootFolderStep());
}

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/UiFramework.cs

@ -5,6 +5,7 @@
NotSpecified = 0,
None = 1,
Mvc = 2,
Angular = 3
Angular = 3,
Blazor = 4
}
}
}

3
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/UiFrameworkExtensions.cs

@ -9,9 +9,10 @@
case UiFramework.None: return "none";
case UiFramework.Mvc: return "mvc";
case UiFramework.Angular: return "angular";
case UiFramework.Blazor: return "blazor";
case UiFramework.NotSpecified: return "NotSpecified";
default: return "NotSpecified";
}
}
}
}
}

30
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs

@ -65,12 +65,22 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App
ConfigureWithAngularUi(context, steps);
break;
case UiFramework.Blazor:
ConfigureWithBlazorUi(context, steps);
break;
case UiFramework.Mvc:
case UiFramework.NotSpecified:
ConfigureWithMvcUi(context, steps);
break;
}
if (context.BuildArgs.UiFramework != UiFramework.Blazor)
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor"));
}
if (context.BuildArgs.UiFramework != UiFramework.Angular)
{
steps.Add(new RemoveFolderStep("/angular"));
@ -101,6 +111,26 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App
}
}
private static void ConfigureWithBlazorUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests"));
if (context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server"))
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds"));
steps.Add(new BlazorAppsettingsFilePortChangeForSeparatedIdentityServersStep());
}
else
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new AppTemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305"));
}
}
private static void ConfigureWithMvcUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
if (context.BuildArgs.ExtraProperties.ContainsKey("tiered"))

39
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/BlazorAppsettingsFilePortChangeForSeparatedIdentityServersStep.cs

@ -0,0 +1,39 @@
using System;
using System.Linq;
using Volo.Abp.Cli.ProjectBuilding.Building;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App
{
public class BlazorAppsettingsFilePortChangeForSeparatedIdentityServersStep : ProjectBuildPipelineStep
{
public override void Execute(ProjectBuildContext context)
{
var appsettingsFile = context.Files.FirstOrDefault(x =>
!x.IsDirectory &&
x.Name.EndsWith("aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/appsettings.json",
StringComparison.InvariantCultureIgnoreCase)
);
appsettingsFile.NormalizeLineEndings();
var lines = appsettingsFile.GetLines();
for (var i = 0; i < lines.Length; i++)
{
var line = lines[i];
if (line.Contains("Authority") && line.Contains("localhost"))
{
line = line.Replace("44305", "44301");
}
else if (line.Contains("BaseUrl") && line.Contains("localhost"))
{
line = line.Replace("44305", "44300");
}
lines[i] = line;
}
appsettingsFile.SetLines(lines);
}
}
}

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

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.10.4" />
<PackageReference Include="MongoDB.Driver" Version="2.11.1" />
</ItemGroup>
<ItemGroup>

102
framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs

@ -29,6 +29,8 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
public virtual IMongoDatabase Database => DbContext.Database;
public virtual IClientSessionHandle SessionHandle => DbContext.SessionHandle;
public virtual TMongoDbContext DbContext => DbContextProvider.GetDbContext();
protected IMongoDbContextProvider<TMongoDbContext> DbContextProvider { get; }
@ -60,10 +62,21 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
{
await ApplyAbpConceptsForAddedEntityAsync(entity);
await Collection.InsertOneAsync(
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
if (SessionHandle != null)
{
await Collection.InsertOneAsync(
SessionHandle,
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
}
else
{
await Collection.InsertOneAsync(
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
}
return entity;
}
@ -88,12 +101,27 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
await TriggerDomainEventsAsync(entity);
var oldConcurrencyStamp = SetNewConcurrencyStamp(entity);
ReplaceOneResult result;
if (SessionHandle != null)
{
result = await Collection.ReplaceOneAsync(
SessionHandle,
CreateEntityFilter(entity, true, oldConcurrencyStamp),
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
var result = await Collection.ReplaceOneAsync(
CreateEntityFilter(entity, true, oldConcurrencyStamp),
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
}
else
{
result = await Collection.ReplaceOneAsync(
CreateEntityFilter(entity, true, oldConcurrencyStamp),
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
}
if (result.MatchedCount <= 0)
{
@ -114,11 +142,25 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
if (entity is ISoftDelete softDeleteEntity && !IsHardDeleted(entity))
{
softDeleteEntity.IsDeleted = true;
var result = await Collection.ReplaceOneAsync(
CreateEntityFilter(entity, true, oldConcurrencyStamp),
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
ReplaceOneResult result;
if (SessionHandle != null)
{
result = await Collection.ReplaceOneAsync(
SessionHandle,
CreateEntityFilter(entity, true, oldConcurrencyStamp),
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
}
else
{
result = await Collection.ReplaceOneAsync(
CreateEntityFilter(entity, true, oldConcurrencyStamp),
entity,
cancellationToken: GetCancellationToken(cancellationToken)
);
}
if (result.MatchedCount <= 0)
{
@ -127,10 +169,23 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
}
else
{
var result = await Collection.DeleteOneAsync(
CreateEntityFilter(entity, true, oldConcurrencyStamp),
GetCancellationToken(cancellationToken)
);
DeleteResult result;
if (SessionHandle != null)
{
result = await Collection.DeleteOneAsync(
SessionHandle,
CreateEntityFilter(entity, true, oldConcurrencyStamp),
cancellationToken: GetCancellationToken(cancellationToken)
);
}
else
{
result = await Collection.DeleteOneAsync(
CreateEntityFilter(entity, true, oldConcurrencyStamp),
GetCancellationToken(cancellationToken)
);
}
if (result.DeletedCount <= 0)
{
@ -195,9 +250,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
public virtual IMongoQueryable<TEntity> GetMongoQueryable()
{
return ApplyDataFilters(
Collection.AsQueryable()
);
return ApplyDataFilters(SessionHandle != null ? Collection.AsQueryable(SessionHandle) : Collection.AsQueryable());
}
protected virtual bool IsHardDeleted(TEntity entity)
{
@ -404,6 +457,13 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
bool includeDetails = true,
CancellationToken cancellationToken = default)
{
if (SessionHandle != null)
{
return await Collection
.Find(SessionHandle, RepositoryFilterer.CreateEntityFilter(id, true))
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
return await Collection
.Find(RepositoryFilterer.CreateEntityFilter(id, true))
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));

14
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbContext.cs

@ -1,4 +1,5 @@
using System.Collections.Generic;
using MongoDB.Bson;
using MongoDB.Driver;
using Volo.Abp.DependencyInjection;
@ -10,14 +11,17 @@ namespace Volo.Abp.MongoDB
public IMongoDatabase Database { get; private set; }
public IClientSessionHandle SessionHandle { get; private set; }
protected internal virtual void CreateModel(IMongoModelBuilder modelBuilder)
{
}
public virtual void InitializeDatabase(IMongoDatabase database)
public virtual void InitializeDatabase(IMongoDatabase database, IClientSessionHandle sessionHandle)
{
Database = database;
SessionHandle = sessionHandle;
}
public virtual IMongoCollection<T> Collection<T>()
@ -25,6 +29,12 @@ namespace Volo.Abp.MongoDB
return Database.GetCollection<T>(GetCollectionName<T>());
}
public virtual void InitializeCollections(IMongoDatabase database)
{
Database = database;
ModelSource.GetModel(this);
}
protected virtual string GetCollectionName<T>()
{
return GetEntityModel<T>().CollectionName;
@ -42,4 +52,4 @@ namespace Volo.Abp.MongoDB
return model;
}
}
}
}

13
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs

@ -1,7 +1,9 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.Domain;
using Volo.Abp.Domain.Repositories.MongoDB;
using Volo.Abp.Modularity;
using Volo.Abp.MongoDB.DependencyInjection;
using Volo.Abp.Uow.MongoDB;
namespace Volo.Abp.MongoDB
@ -9,18 +11,23 @@ namespace Volo.Abp.MongoDB
[DependsOn(typeof(AbpDddDomainModule))]
public class AbpMongoDbModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddConventionalRegistrar(new AbpMongoDbConventionalRegistrar());
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.TryAddTransient(
typeof(IMongoDbContextProvider<>),
typeof(UnitOfWorkMongoDbContextProvider<>)
);
context.Services.TryAddTransient(
typeof(IMongoDbRepositoryFilterer<>),
typeof(MongoDbRepositoryFilterer<>)
);
context.Services.TryAddTransient(
typeof(IMongoDbRepositoryFilterer<,>),
typeof(MongoDbRepositoryFilterer<,>)

27
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DependencyInjection/AbpMongoDbConventionalRegistrar.cs

@ -0,0 +1,27 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.MongoDB.DependencyInjection
{
public class AbpMongoDbConventionalRegistrar : DefaultConventionalRegistrar
{
public override void AddType(IServiceCollection services, Type type)
{
if (!typeof(IAbpMongoDbContext).IsAssignableFrom(type) || type == typeof(AbpMongoDbContext))
{
return;
}
var dependencyAttribute = GetDependencyAttributeOrNull(type);
var lifeTime = GetLifeTimeOrNull(type, dependencyAttribute);
if (lifeTime == null)
{
return;
}
services.Add(ServiceDescriptor.Describe(typeof(IAbpMongoDbContext), type, ServiceLifetime.Transient));
}
}
}

4
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/IAbpMongoDbContext.cs

@ -7,5 +7,7 @@ namespace Volo.Abp.MongoDB
IMongoDatabase Database { get; }
IMongoCollection<T> Collection<T>();
IClientSessionHandle SessionHandle { get; }
}
}
}

19
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoModelBuilder.cs

@ -3,6 +3,8 @@ using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using MongoDB.Bson;
using MongoDB.Driver;
using Volo.Abp.Domain.Entities;
namespace Volo.Abp.MongoDB
@ -18,7 +20,7 @@ namespace Volo.Abp.MongoDB
_entityModelBuilders = new Dictionary<Type, object>();
}
public MongoDbContextModel Build()
public MongoDbContextModel Build(AbpMongoDbContext dbContext)
{
lock (SyncObj)
{
@ -38,6 +40,8 @@ namespace Volo.Abp.MongoDB
}
baseClasses.AddRange(entityModel.EntityType.GetBaseClasses(includeObject: false));
CreateCollectionIfNotExists(dbContext, entityModel.CollectionName);
}
baseClasses = baseClasses.Distinct().ToList();
@ -84,5 +88,16 @@ namespace Volo.Abp.MongoDB
{
return _entityModelBuilders.Values.Cast<IMongoEntityModel>().ToImmutableList();
}
protected virtual void CreateCollectionIfNotExists(AbpMongoDbContext dbContext, string collectionName)
{
var filter = new BsonDocument("name", collectionName);
var options = new ListCollectionNamesOptions { Filter = filter };
if (!dbContext.Database.ListCollectionNames(options).Any())
{
dbContext.Database.CreateCollection(collectionName);
}
}
}
}
}

6
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoModelSource.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.MongoDB
public class MongoModelSource : IMongoModelSource, ISingletonDependency
{
protected readonly ConcurrentDictionary<Type, MongoDbContextModel> ModelCache = new ConcurrentDictionary<Type, MongoDbContextModel>();
public virtual MongoDbContextModel GetModel(AbpMongoDbContext dbContext)
{
return ModelCache.GetOrAdd(
@ -26,7 +26,7 @@ namespace Volo.Abp.MongoDB
var modelBuilder = CreateModelBuilder();
BuildModelFromDbContextType(modelBuilder, dbContext.GetType());
BuildModelFromDbContextInstance(modelBuilder, dbContext);
return modelBuilder.Build();
return modelBuilder.Build(dbContext);
}
protected virtual MongoModelBuilder CreateModelBuilder()
@ -65,4 +65,4 @@ namespace Volo.Abp.MongoDB
dbContext.CreateModel(modelBuilder);
}
}
}
}

42
framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/MongoDbTransactionApi.cs

@ -0,0 +1,42 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
namespace Volo.Abp.Uow.MongoDB
{
public class MongoDbTransactionApi : ITransactionApi, ISupportsRollback
{
public IClientSessionHandle SessionHandle { get; }
public MongoDbTransactionApi(IClientSessionHandle sessionHandle)
{
SessionHandle = sessionHandle;
}
public async Task CommitAsync()
{
await SessionHandle.CommitTransactionAsync();
}
protected void Commit()
{
SessionHandle.CommitTransaction();
}
public void Dispose()
{
SessionHandle.Dispose();
}
public void Rollback()
{
SessionHandle.AbortTransaction();
}
public async Task RollbackAsync(CancellationToken cancellationToken)
{
await SessionHandle.AbortTransactionAsync(cancellationToken);
}
}
}

63
framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs

@ -1,5 +1,6 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Bson;
using MongoDB.Driver;
using Volo.Abp.Data;
using Volo.Abp.MongoDB;
@ -25,7 +26,8 @@ namespace Volo.Abp.Uow.MongoDB
var unitOfWork = _unitOfWorkManager.Current;
if (unitOfWork == null)
{
throw new AbpException($"A {nameof(IMongoDatabase)} instance can only be created inside a unit of work!");
throw new AbpException(
$"A {nameof(IMongoDatabase)} instance can only be created inside a unit of work!");
}
var connectionString = _connectionStringResolver.Resolve<TMongoDbContext>();
@ -41,18 +43,61 @@ namespace Volo.Abp.Uow.MongoDB
//TODO: Create only single MongoDbClient per connection string in an application (extract MongoClientCache for example).
var databaseApi = unitOfWork.GetOrAddDatabaseApi(
dbContextKey,
() =>
() => new MongoDbDatabaseApi<TMongoDbContext>(CreateDbContext(unitOfWork, mongoUrl, databaseName)));
return ((MongoDbDatabaseApi<TMongoDbContext>) databaseApi).DbContext;
}
private TMongoDbContext CreateDbContext(IUnitOfWork unitOfWork, MongoUrl mongoUrl, string databaseName)
{
var client = new MongoClient(mongoUrl);
var database = client.GetDatabase(databaseName);
if (unitOfWork.Options.IsTransactional)
{
return CreateDbContextWithTransaction(unitOfWork, mongoUrl, client, database);
}
var dbContext = unitOfWork.ServiceProvider.GetRequiredService<TMongoDbContext>();
dbContext.ToAbpMongoDbContext().InitializeDatabase(database, null);
return dbContext;
}
public TMongoDbContext CreateDbContextWithTransaction(
IUnitOfWork unitOfWork,
MongoUrl url,
MongoClient client,
IMongoDatabase database)
{
var transactionApiKey = $"MongoDb_{url}";
var activeTransaction = unitOfWork.FindTransactionApi(transactionApiKey) as MongoDbTransactionApi;
var dbContext = unitOfWork.ServiceProvider.GetRequiredService<TMongoDbContext>();
if (activeTransaction?.SessionHandle == null)
{
var session = client.StartSession();
if (unitOfWork.Options.Timeout.HasValue)
{
var database = new MongoClient(mongoUrl).GetDatabase(databaseName);
session.AdvanceOperationTime(new BsonTimestamp(unitOfWork.Options.Timeout.Value));
}
var dbContext = unitOfWork.ServiceProvider.GetRequiredService<TMongoDbContext>();
session.StartTransaction();
dbContext.ToAbpMongoDbContext().InitializeDatabase(database);
unitOfWork.AddTransactionApi(
transactionApiKey,
new MongoDbTransactionApi(session)
);
return new MongoDbDatabaseApi<TMongoDbContext>(dbContext);
});
dbContext.ToAbpMongoDbContext().InitializeDatabase(database, session);
}
else
{
dbContext.ToAbpMongoDbContext().InitializeDatabase(database, activeTransaction.SessionHandle);
}
return ((MongoDbDatabaseApi<TMongoDbContext>)databaseApi).DbContext;
return dbContext;
}
}
}
}

12
framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs

@ -1,10 +1,15 @@
using System;
using System.Linq;
using System.Threading;
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Driver;
using MongoDB.Driver.Core.Servers;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.TestApp;
using Volo.Abp.TestApp.Domain;
using Volo.Abp.TestApp.MongoDB;
using Volo.Abp.Uow;
namespace Volo.Abp.MongoDB
{
@ -16,7 +21,7 @@ namespace Volo.Abp.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
@ -30,6 +35,11 @@ namespace Volo.Abp.MongoDB
options.AddDefaultRepositories<ITestAppMongoDbContext>();
options.AddRepository<City, CityRepository>();
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

7
modules/account/Volo.Abp.Account.sln

@ -21,6 +21,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{12FAE513-7
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Account.Application.Tests", "test\Volo.Abp.Account.Application.Tests\Volo.Abp.Account.Application.Tests.csproj", "{356EAC51-5D55-4852-A8A5-2F90EAC8DAE3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Account.Blazor", "src\Volo.Abp.Account.Blazor\Volo.Abp.Account.Blazor.csproj", "{EE8858B3-A638-481B-8EB9-74F5E7D43D80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -55,6 +57,10 @@ Global
{356EAC51-5D55-4852-A8A5-2F90EAC8DAE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{356EAC51-5D55-4852-A8A5-2F90EAC8DAE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{356EAC51-5D55-4852-A8A5-2F90EAC8DAE3}.Release|Any CPU.Build.0 = Release|Any CPU
{EE8858B3-A638-481B-8EB9-74F5E7D43D80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE8858B3-A638-481B-8EB9-74F5E7D43D80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE8858B3-A638-481B-8EB9-74F5E7D43D80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE8858B3-A638-481B-8EB9-74F5E7D43D80}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -67,6 +73,7 @@ Global
{EBF0C2B3-14CB-4DFC-9753-ECBF959CBA2E} = {B5881429-EFF7-4F30-8C0B-0AC41E36B74E}
{7BCA5955-B3F6-41E8-9D5D-D115195C6098} = {B5881429-EFF7-4F30-8C0B-0AC41E36B74E}
{356EAC51-5D55-4852-A8A5-2F90EAC8DAE3} = {12FAE513-7575-4235-89DF-277BA1A3B098}
{EE8858B3-A638-481B-8EB9-74F5E7D43D80} = {B5881429-EFF7-4F30-8C0B-0AC41E36B74E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2B054393-D2B2-4EA8-8A15-D60CBCF3E7A9}

20
modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorAutoMapperProfile.cs

@ -0,0 +1,20 @@
using AutoMapper;
using Volo.Abp.Account.Blazor.Pages.Account;
using Volo.Abp.AutoMapper;
using Volo.Abp.Identity;
namespace Volo.Abp.Account.Blazor
{
public class AbpAccountBlazorAutoMapperProfile : Profile
{
public AbpAccountBlazorAutoMapperProfile()
{
CreateMap<ProfileDto, PersonalInfoModel>()
.Ignore(x => x.PhoneNumberConfirmed)
.Ignore(x => x.EmailConfirmed);
CreateMap<PersonalInfoModel, UpdateProfileDto>()
.Ignore(x => x.ExtraProperties);
}
}
}

37
modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorModule.cs

@ -0,0 +1,37 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming;
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Routing;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.Account.Blazor
{
[DependsOn(
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule),
typeof(AbpAutoMapperModule),
typeof(AbpAccountHttpApiClientModule)
)]
public class AbpAccountBlazorModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpAccountBlazorModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpAccountBlazorAutoMapperProfile>(validate: true);
});
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new AbpAccountBlazorUserMenuContributor());
});
Configure<AbpRouterOptions>(options =>
{
options.AdditionalAssemblies.Add(typeof(AbpAccountBlazorModule).Assembly);
});
}
}
}

23
modules/account/src/Volo.Abp.Account.Blazor/AbpAccountBlazorUserMenuContributor.cs

@ -0,0 +1,23 @@
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.Account.Blazor
{
public class AbpAccountBlazorUserMenuContributor : IMenuContributor
{
public Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name != StandardMenus.User)
{
return Task.CompletedTask;
}
var accountResource = context.GetLocalizer<AccountResource>();
context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", accountResource["ManageYourProfile"], url: "account/manage-profile", icon: "fa fa-cog"));
return Task.CompletedTask;
}
}
}

3
modules/account/src/Volo.Abp.Account.Blazor/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
modules/account/src/Volo.Abp.Account.Blazor/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

64
modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor

@ -0,0 +1,64 @@
@page "/account/manage-profile"
@inherits AccountManageBase
<Row>
<Column ColumnSize="ColumnSize.Is12">
<Tabs @bind-SelectedTab="@SelectedTab" TabPosition="TabPosition.Left" Pills="true">
<Items>
<Tab Name="Password">@L["ProfileTab:Password"]</Tab>
<Tab Name="PersonalInfo">@L["ProfileTab:PersonalInfo"]</Tab>
</Items>
<Content>
@if (ChangePasswordModel != null)
{
<TabPanel Name="Password">
<Field>
<FieldLabel>@L["DisplayName:CurrentPassword"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.CurrentPassword" />
</Field>
<Field>
<FieldLabel>@L["DisplayName:NewPassword"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPassword" />
</Field>
<Field>
<FieldLabel>@L["DisplayName:NewPasswordConfirm"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPasswordConfirm" />
</Field>
<Field>
<Button Color="Color.Primary" Clicked="@ChangePasswordAsync">@L["Save"]</Button>
</Field>
</TabPanel>
}
@if (PersonalInfoModel != null)
{
<TabPanel Name="PersonalInfo">
<Field>
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.UserName" />
</Field>
<Fields>
<Field ColumnSize="ColumnSize.Is6">
<FieldLabel>@L["DisplayName:Name"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.Name" />
</Field>
<Field ColumnSize="ColumnSize.Is6">
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.Surname" />
</Field>
</Fields>
<Field>
<FieldLabel>@L["DisplayName:Email"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.Email" />
</Field>
<Field>
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.PhoneNumber" />
</Field>
<Field>
<Button Color="Color.Primary" Clicked="@UpdatePersonalInfoAsync">@L["Save"]</Button>
</Field>
</TabPanel>
}
</Content>
</Tabs>
</Column>
</Row>

117
modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor.cs

@ -0,0 +1,117 @@
using System.Threading.Tasks;
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using Volo.Abp.Account.Localization;
using Volo.Abp.AspNetCore.Components.WebAssembly;
using Volo.Abp.Identity;
using Volo.Abp.ObjectMapping;
namespace Volo.Abp.Account.Blazor.Pages.Account
{
public class AccountManageBase : OwningComponentBase
{
[Inject] protected IAccountAppService AccountAppService { get; set; }
[Inject] protected IProfileAppService ProfileAppService { get; set; }
[Inject] protected IObjectMapper<AbpAccountBlazorModule> ObjectMapper { get; set; }
[Inject] protected IUiMessageService UiMessageService { get; set; }
[Inject] protected IStringLocalizer<AbpUiResource> UiLocalizer { get; set; }
[Inject] protected IStringLocalizer<AccountResource> L { get; set; }
protected string SelectedTab = "Password";
protected ChangePasswordModel ChangePasswordModel;
protected PersonalInfoModel PersonalInfoModel;
protected override async Task OnInitializedAsync()
{
await GetUserInformations();
}
protected async Task GetUserInformations()
{
var user = await ProfileAppService.GetAsync();
ChangePasswordModel = new ChangePasswordModel
{
HideOldPasswordInput = !user.HasPassword
};
PersonalInfoModel = ObjectMapper.Map<ProfileDto, PersonalInfoModel>(user);
}
protected async Task ChangePasswordAsync()
{
if (string.IsNullOrWhiteSpace(ChangePasswordModel.CurrentPassword))
{
return;
}
if (ChangePasswordModel.NewPassword != ChangePasswordModel.NewPasswordConfirm)
{
await UiMessageService.WarnAsync(L["NewPasswordConfirmFailed"]);
return;
}
if (!await UiMessageService.ConfirmAsync(UiLocalizer["AreYouSure"]))
{
return;
}
await ProfileAppService.ChangePasswordAsync(new ChangePasswordInput
{
CurrentPassword = ChangePasswordModel.CurrentPassword,
NewPassword = ChangePasswordModel.NewPassword
});
await UiMessageService.SuccessAsync(L["PasswordChanged"]);
}
protected async Task UpdatePersonalInfoAsync()
{
if (!await UiMessageService.ConfirmAsync(UiLocalizer["AreYouSure"]))
{
return;
}
await ProfileAppService.UpdateAsync(
ObjectMapper.Map<PersonalInfoModel, UpdateProfileDto>(PersonalInfoModel)
);
await UiMessageService.SuccessAsync(L["PersonalSettingsSaved"]);
}
}
public class ChangePasswordModel
{
public string CurrentPassword { get; set; }
public string NewPassword { get; set; }
public string NewPasswordConfirm { get; set; }
public bool HideOldPasswordInput { get; set; }
}
public class PersonalInfoModel
{
public string UserName { get; set; }
public string Email { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string PhoneNumber { get; set; }
public bool PhoneNumberConfirmed { get; set; }
public bool EmailConfirmed { get; set; }
}
}

27
modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<RootNamespace>Volo.Abp.Account.Blazor</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Account.HttpApi.Client\Volo.Abp.Account.HttpApi.Client.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="Pages\Account\Manage.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>
</Project>

5
modules/account/src/Volo.Abp.Account.Blazor/_Imports.razor

@ -0,0 +1,5 @@
@using Microsoft.AspNetCore.Components.Web
@using Volo.Abp.AspNetCore.Components.WebAssembly
@using Volo.Abp.BlazoriseUI
@using Blazorise
@using Blazorise.DataGrid

12
modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.AuditLogging.MongoDB
{
@ -12,14 +13,19 @@ namespace Volo.Abp.AuditLogging.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}
}

12
modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.BackgroundJobs.MongoDB
{
@ -12,14 +13,19 @@ namespace Volo.Abp.BackgroundJobs.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}
}

14
modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs

@ -1,25 +1,31 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.BlobStoring.Database.MongoDB
{
[DependsOn(
typeof(BlobStoringDatabaseTestBaseModule),
typeof(BlobStoringDatabaseMongoDbModule)
)]
)]
public class BlobStoringDatabaseMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}
}

12
modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Blogging.MongoDB
{
@ -12,14 +13,19 @@ namespace Volo.Blogging.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}
}

14
modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/CmsKitMongoDbTestModule.cs

@ -1,25 +1,31 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.CmsKit.MongoDB
{
[DependsOn(
typeof(CmsKitTestBaseModule),
typeof(CmsKitMongoDbModule)
)]
)]
public class CmsKitMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}
}

10
modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/DocsMongoDBTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Docs.MongoDB
{
@ -12,14 +13,19 @@ namespace Volo.Docs.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

6
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/AbpFeatureManagementDomainSharedModule.cs

@ -1,5 +1,6 @@
using Volo.Abp.FeatureManagement.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
using Volo.Abp.Validation.Localization;
@ -27,6 +28,11 @@ namespace Volo.Abp.FeatureManagement
typeof(AbpValidationResource)
).AddVirtualJson("Volo/Abp/FeatureManagement/Localization/Domain");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Volo.Abp.FeatureManagement", typeof(AbpFeatureManagementResource));
});
}
}
}

6
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/FeatureManagementDomainErrorCodes.cs

@ -1,7 +1,9 @@
namespace Volo.Abp.FeatureManagement
using System;
namespace Volo.Abp.FeatureManagement
{
public static class FeatureManagementDomainErrorCodes
{
public const string FeatureValueInvalid = "Volo.Abp.FeatureManagement:InvalidFeatureValue";
}
}

14
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/FeatureValueInvalidException.cs

@ -0,0 +1,14 @@
using System;
namespace Volo.Abp.FeatureManagement
{
[Serializable]
public class FeatureValueInvalidException : BusinessException
{
public FeatureValueInvalidException(string name) :
base(FeatureManagementDomainErrorCodes.FeatureValueInvalid)
{
WithData("0", name);
}
}
}

5
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/ar.json

@ -2,6 +2,7 @@
"culture": "ar",
"texts": {
"Features": "المميزات",
"NoFeatureFoundMessage": "لا توجد أي ميزة متاحة."
"NoFeatureFoundMessage": "لا توجد أي ميزة متاحة.",
"Volo.Abp.FeatureManagement:InvalidFeatureValue" : "{0} قيمة الميزة غير صالحة!"
}
}
}

5
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/de.json

@ -2,6 +2,7 @@
"culture": "de",
"texts": {
"Features": "Funktionen",
"NoFeatureFoundMessage": "Es ist keine Funktion verfügbar."
"NoFeatureFoundMessage": "Es ist keine Funktion verfügbar.",
"Volo.Abp.FeatureManagement:InvalidFeatureValue" : "Der {0} -Feature-Wert ist ungültig!"
}
}
}

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/en.json

@ -4,6 +4,7 @@
"Features": "Features",
"NoFeatureFoundMessage": "There isn't any available feature.",
"Permission:FeatureManagement": "Feature management",
"Permission:FeatureManagement.ManageHostFeatures": "Manage Host features"
"Permission:FeatureManagement.ManageHostFeatures": "Manage Host features",
"Volo.Abp.FeatureManagement:InvalidFeatureValue" : "{0} feature value is not valid!"
}
}

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/ru.json

@ -2,6 +2,7 @@
"culture": "ru",
"texts": {
"Features": "Функциональные возможности",
"NoFeatureFoundMessage": "Нет доступных функциональных возможностей."
"NoFeatureFoundMessage": "Нет доступных функциональных возможностей.",
"Volo.Abp.FeatureManagement:InvalidFeatureValue" : "Недопустимое значение функции {0}!"
}
}

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/tr.json

@ -4,6 +4,7 @@
"Features": "Özellikler",
"NoFeatureFoundMessage": "Hiç özellik yok.",
"Permission:FeatureManagement": "Özellik yönetimi",
"Permission:FeatureManagement.ManageHostFeatures": "Host özelliklerini düzenle"
"Permission:FeatureManagement.ManageHostFeatures": "Host özelliklerini düzenle",
"Volo.Abp.FeatureManagement:InvalidFeatureValue" : "{0} özellik değeri geçerli değil!"
}
}

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/zh-Hans.json

@ -4,6 +4,7 @@
"Features": "功能",
"NoFeatureFoundMessage": "没有可用的功能.",
"Permission:FeatureManagement": "特性管理",
"Permission:FeatureManagement.ManageHostFeatures": "管理Host特性"
"Permission:FeatureManagement.ManageHostFeatures": "管理Host特性",
"Volo.Abp.FeatureManagement:InvalidFeatureValue" : "{0}功能的值无效!"
}
}

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/zh-Hant.json

@ -4,6 +4,7 @@
"Features": "功能",
"NoFeatureFoundMessage": "沒有可用的功能.",
"Permission:FeatureManagement": "功能管理",
"Permission:FeatureManagement.ManageHostFeatures": "管理Host功能"
"Permission:FeatureManagement.ManageHostFeatures": "管理Host功能",
"Volo.Abp.FeatureManagement:InvalidFeatureValue" : "{0}功能的值無效!"
}
}

17
modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManager.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Features;
@ -14,15 +15,18 @@ namespace Volo.Abp.FeatureManagement
protected IFeatureDefinitionManager FeatureDefinitionManager { get; }
protected List<IFeatureManagementProvider> Providers => _lazyProviders.Value;
protected FeatureManagementOptions Options { get; }
protected IStringLocalizerFactory StringLocalizerFactory { get; }
private readonly Lazy<List<IFeatureManagementProvider>> _lazyProviders;
public FeatureManager(
IOptions<FeatureManagementOptions> options,
IServiceProvider serviceProvider,
IFeatureDefinitionManager featureDefinitionManager)
IFeatureDefinitionManager featureDefinitionManager,
IStringLocalizerFactory stringLocalizerFactory)
{
FeatureDefinitionManager = featureDefinitionManager;
StringLocalizerFactory = stringLocalizerFactory;
Options = options.Value;
//TODO: Instead, use IHybridServiceScopeFactory and create a scope..?
@ -57,7 +61,8 @@ namespace Volo.Abp.FeatureManagement
.Select(x => new FeatureNameValue(x.Name, x.Value)).ToList();
}
public async Task<FeatureNameValueWithGrantedProvider> GetOrNullWithProviderAsync(string name, string providerName, string providerKey, bool fallback = true)
public async Task<FeatureNameValueWithGrantedProvider> GetOrNullWithProviderAsync(string name,
string providerName, string providerKey, bool fallback = true)
{
Check.NotNull(name, nameof(name));
Check.NotNull(providerName, nameof(providerName));
@ -65,7 +70,8 @@ namespace Volo.Abp.FeatureManagement
return await GetOrNullInternalAsync(name, providerName, providerKey, fallback);
}
public async Task<List<FeatureNameValueWithGrantedProvider>> GetAllWithProviderAsync(string providerName, string providerKey, bool fallback = true)
public async Task<List<FeatureNameValueWithGrantedProvider>> GetAllWithProviderAsync(string providerName,
string providerKey, bool fallback = true)
{
Check.NotNull(providerName, nameof(providerName));
@ -128,6 +134,11 @@ namespace Volo.Abp.FeatureManagement
var feature = FeatureDefinitionManager.Get(name);
if (!feature.ValueType.Validator.IsValid(value))
{
throw new FeatureValueInvalidException(feature.DisplayName.Localize(StringLocalizerFactory));
}
var providers = Enumerable
.Reverse(Providers)
.SkipWhile(p => p.Name != providerName)

83
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml

@ -24,55 +24,80 @@
<abp-modal-header title="@(L["Features"].Value)"></abp-modal-header>
@if (Model.FeatureListResultDto != null && Model.FeatureListResultDto.Groups.Any())
{
var featureGroups = Model.FeatureListResultDto.Groups;
<abp-modal-body class="ml-4">
<input asp-for="@Model.ProviderKey"/>
<input asp-for="@Model.ProviderName"/>
<abp-tabs name="FeaturesTabs" tab-style="PillVertical" vertical-header-size="_4" class="custom-scroll-container">
@for (var i = 0; i < Model.FeatureListResultDto.Groups.Count; i++)
@for (var i = 0; i < featureGroups.Count; i++)
{
<abp-tab title="@Model.FeatureListResultDto.Groups[i].DisplayName" name="v-pills-tab-@Model.FeatureListResultDto.Groups[i].GetNormalizedGroupName()">
<h4>@Model.FeatureListResultDto.Groups[i].DisplayName</h4>
<abp-tab title="@featureGroups[i].DisplayName" name="v-pills-tab-@featureGroups[i].GetNormalizedGroupName()">
<h4>@featureGroups[i].DisplayName</h4>
<hr class="mt-2 mb-3"/>
<div class="custom-scroll-content">
<div class="pl-1 pt-1">
@for (var j = 0; j < Model.FeatureListResultDto.Groups[i].Features.Count; j++)
@for (var j = 0; j < featureGroups[i].Features.Count; j++)
{
var feature = Model.FeatureListResultDto.Groups[i].Features[j];
var feature = featureGroups[i].Features[j];
var disabled = Model.IsDisabled(feature.Provider.Name);
<div class="mt-2" style="padding-left: @(feature.Depth * 20)px">
<span class="mr-2">@feature.DisplayName @(disabled ? $"({feature.Provider.Name})" : "")</span>
<div class="mt-2">
<input type="text" name="FeatureGroups[@i].Features[@j].ProviderName" value="@feature.Provider.Name" hidden/>
<input type="text" name="FeatureGroups[@i].Features[@j].Type" value="@feature.ValueType?.Name" hidden/>
@if (feature.ValueType is ToggleStringValueType)
{
<abp-input asp-for="@featureGroups[i].Features[j].Value"
type="checkbox"
name="FeatureGroups[@i].Features[@j].BoolValue"
label="@feature.DisplayName"
disabled="@disabled"
group-data-feature-name="@feature.Name"
group-data-parent-name="@(feature.ParentName ?? "")"
group-style="margin-left: @(feature.Depth * 20)px"/>
}
@if (feature.ValueType is FreeTextStringValueType)
{
<input type="text" name="FeatureGroups[@i].Features[@j].Name" value="@feature.Name" hidden/>
<input disabled="@disabled" type="text" name="FeatureGroups[@i].Features[@j].Value" value="@feature.Value"/>
var type = "text";
if(feature.ValueType.Validator is NumericValueValidator)
{
type = "number";
}
<abp-input asp-for="@featureGroups[i].Features[j].Value"
label="@feature.DisplayName"
disabled="@disabled"
type="@type"
group-data-feature-name="@feature.Name"
group-data-parent-name="@(feature.ParentName ?? "")"
group-style="margin-left: @(feature.Depth * 25)px"/>
}
@if (feature.ValueType is SelectionStringValueType)
@if (feature.ValueType is SelectionStringValueType selectType)
{
<input type="text" name="FeatureGroups[@i].Features[@j].Name" value="@feature.Name" hidden/>
<select disabled="@disabled" name="FeatureGroups[@i].Features[@j].Value">
@foreach (var item in (feature.ValueType as SelectionStringValueType).ItemSource.Items)
{
if (item.Value == feature.Value)
{
<option value="@item.Value" selected="selected"> @CreateHtmlLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) </option>
}
else
<div data-feature-name="@feature.Name" data-parent-name="@(feature.ParentName ?? "")" style="margin-left: @(feature.Depth * 25)px" class="form-group">
<label for="@feature.Name">@feature.DisplayName</label>
<select id="@feature.Name" name="FeatureGroups[@i].Features[@j].Value" class="custom-select form-control">
@foreach (var item in selectType.ItemSource.Items)
{
<option value="@item.Value"> @CreateHtmlLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) </option>
if (item.Value == feature.Value)
{
<option value="@item.Value" selected="selected"> @CreateHtmlLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) </option>
}
else
{
<option value="@item.Value"> @CreateHtmlLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) </option>
}
}
}
</select>
}
@if (feature.ValueType is ToggleStringValueType)
{
<input type="text" name="FeatureGroups[@i].Features[@j].Name" value="@feature.Name" hidden/>
<input disabled="@disabled" type="checkbox" class="FeatureValueCheckbox" name="FeatureGroups[@i].Features[@j].BoolValue" value="@feature.Value"
@Html.Raw(feature.Value == "True" ? "checked" : "")/>
</select>
</div>
}
<input value="@feature.Name" name="FeatureGroups[@i].Features[@j].Name" hidden=""/>
</div>
}
</div>

75
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js

@ -3,12 +3,75 @@
abp.modals = abp.modals || {};
abp.modals.FeatureManagement = function () {
$('.FeatureValueCheckbox').change(function () {
if (this.checked) {
$(this).val('true');
} else {
$(this).val('false');
function checkParents($tab, $element, className) {
var parentName = $element
.closest(className)
.attr('data-parent-name');
if (!parentName) {
return;
}
$tab.find('.custom-checkbox')
.filter('[data-feature-name="' + parentName + '"]')
.find('input[type="checkbox"]')
.each(function () {
var $parent = $(this);
$parent.prop('checked', true);
checkParents($tab, $parent, className);
});
}
function uncheckChildren($tab, $checkBox) {
var featureName = $checkBox
.closest('.custom-checkbox')
.attr('data-feature-name');
if (!featureName) {
return;
}
});
$tab.find('.custom-checkbox')
.filter('[data-parent-name="' + featureName + '"]')
.find('input[type="checkbox"]')
.each(function () {
var $child = $(this);
$child.prop('checked', false);
uncheckChildren($tab, $child);
});
}
this.initDom = function ($el) {
$el.find('.tab-pane').each(function () {
var $tab = $(this);
$tab.find('input[type="checkbox"]')
.each(function () {
var $checkBox = $(this);
$checkBox.change(function () {
if ($checkBox.is(':checked')) {
checkParents($tab, $checkBox, '.custom-checkbox')
} else {
uncheckChildren($tab, $checkBox);
}
});
});
$tab.find('.form-control')
.each(function () {
var $element = $(this);
$element.change(function () {
checkParents($tab, $element, '.form-group')
});
});
});
$(function () {
$('.custom-scroll-content').mCustomScrollbar({
theme: 'minimal-dark',
});
$('.custom-scroll-container > .col-4').mCustomScrollbar({
theme: 'minimal-dark',
});
});
};
};
})(jQuery);

12
modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/AbpFeatureManagementMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.FeatureManagement.MongoDB
{
@ -12,14 +13,19 @@ namespace Volo.Abp.FeatureManagement.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}
}

8
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor

@ -72,8 +72,8 @@
<TextEdit @bind-text="NewEntity.Name" />
</Field>
<Field>
<Check TValue="bool" @bind-checked="NewEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
<Check TValue="bool" @bind-checked="NewEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
<Check TValue="bool" @bind-checked="@NewEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
<Check TValue="bool" @bind-checked="@NewEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
</Field>
</ModalBody>
<ModalFooter>
@ -98,8 +98,8 @@
<TextEdit @bind-text="EditingEntity.Name" />
</Field>
<Field>
<Check TValue="bool" @bind-checked="EditingEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
<Check TValue="bool" @bind-checked="EditingEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
<Check TValue="bool" @bind-checked="@EditingEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
<Check TValue="bool" @bind-checked="@EditingEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
</Field>
</ModalBody>
<ModalFooter>

4
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor

@ -102,10 +102,10 @@
<TextEdit @bind-text="NewEntity.PhoneNumber" />
</Field>
<Field>
<Check TValue="bool" @bind-checked="NewEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check>
<Check TValue="bool" @bind-checked="@NewEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check>
</Field>
<Field>
<Check TValue="bool" @bind-checked="NewEntity.TwoFactorEnabled">@L["DisplayName:TwoFactorEnabled"]</Check>
<Check TValue="bool" @bind-checked="@NewEntity.TwoFactorEnabled">@L["DisplayName:TwoFactorEnabled"]</Check>
</Field>
</TabPanel>
<TabPanel Name="Roles">

12
modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
using Volo.Abp.PermissionManagement.MongoDB;
namespace Volo.Abp.Identity.MongoDB
@ -9,19 +10,24 @@ namespace Volo.Abp.Identity.MongoDB
typeof(AbpIdentityTestBaseModule),
typeof(AbpPermissionManagementMongoDbModule),
typeof(AbpIdentityMongoDbModule)
)]
)]
public class AbpIdentityMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

8
modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/AbpIdentityServerMongoDbTestModule.cs

@ -3,6 +3,7 @@ using Volo.Abp.Data;
using Volo.Abp.Identity.MongoDB;
using Volo.Abp.IdentityServer.MongoDB;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.IdentityServer
{
@ -16,7 +17,7 @@ namespace Volo.Abp.IdentityServer
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
@ -24,6 +25,11 @@ namespace Volo.Abp.IdentityServer
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

12
modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.PermissionManagement.MongoDB
{
@ -11,14 +12,19 @@ namespace Volo.Abp.PermissionManagement.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

10
modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.SettingManagement.MongoDB
{
@ -12,14 +13,19 @@ namespace Volo.Abp.SettingManagement.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

10
modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.TenantManagement.MongoDB
{
@ -12,14 +13,19 @@ namespace Volo.Abp.TenantManagement.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

2
modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs

@ -1,5 +1,7 @@
using System;
using Mongo2Go;
using MongoDB.Driver;
using Volo.Abp.MongoDB;
namespace Volo.Abp.TenantManagement.MongoDB
{

1
npm/ng-packs/package.json

@ -39,6 +39,7 @@
"@angular-builders/jest": "^10.0.0",
"@angular-devkit/build-angular": "~0.1000.6",
"@angular-devkit/build-ng-packagr": "~0.1000.6",
"@angular-devkit/schematics-cli": "^0.1001.1",
"@angular/animations": "~10.0.10",
"@angular/cli": "~10.0.6",
"@angular/common": "~10.0.10",

20
npm/ng-packs/packages/components/tree/src/lib/utils/nz-tree-adapter.ts

@ -48,8 +48,26 @@ export class TreeAdapter<T extends BaseNode = BaseNode> {
}
handleRemove({ key }: TreeNode<T>) {
this.tree = createTreeFromList(this.list.filter(item => item.id !== key));
this.updateTreeFromList(this.list.filter(item => item.id !== key));
}
handleUpdate({ key, children }: { key: string; children: T[] }) {
/**
* When we need to update a node with new children, first we need to remove any descendant nodes.
* If we remove immediate children and create a new tree, any other descendant nodes will be removed
* and we won't need to recursively remove sub children.
* Then, you simply add back the new children and create a new tree.
*/
const listWithDescendantNodesRemoved = this.updateTreeFromList(
this.list.filter(item => item.parentId !== key),
);
this.updateTreeFromList(listWithDescendantNodesRemoved.concat(children));
}
updateTreeFromList(list: T[]) {
this.tree = createTreeFromList(list);
this.list = createListFromTree(this.tree);
return this.list;
}
}

2
npm/ng-packs/packages/core/src/lib/models/rest.ts

@ -34,7 +34,7 @@ export namespace Rest {
[param: string]: any;
};
reportProgress?: boolean;
responseType?: ResponseType;
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
url: string;
withCredentials?: boolean;
}

13
npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.html

@ -9,19 +9,22 @@
<ul
ngbNav
#nav="ngbNav"
[(activeId)]="selectedGroup"
[(activeId)]="selectedGroupDisplayName"
class="nav-pills"
orientation="vertical"
>
<li *ngFor="let groupName of groups" [ngbNavItem]="groupName">
<a ngbNavLink>{{ groupName }}</a>
<li
*ngFor="let group of groups; trackBy: track.by('name')"
[ngbNavItem]="selectedGroupDisplayName"
>
<a ngbNavLink>{{ group.displayName }}</a>
<ng-template ngbNavContent>
<h4>{{ selectedGroup }}</h4>
<h4>{{ selectedGroupDisplayName }}</h4>
<hr class="mt-2 mb-3" />
<div
class="row my-3"
*ngFor="let feature of features[groupName]; let i = index; trackBy: track.by('id')"
*ngFor="let feature of features[group.name]; let i = index; trackBy: track.by('id')"
[ngStyle]="feature.style"
[ngSwitch]="feature.valueType?.name"
(keyup.enter)="save()"

14
npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts

@ -4,7 +4,11 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
import { finalize } from 'rxjs/operators';
import { FeatureManagement } from '../../models/feature-management';
import { FeaturesService } from '../../proxy/feature-management/features.service';
import { FeatureDto, UpdateFeatureDto } from '../../proxy/feature-management/models';
import {
FeatureDto,
FeatureGroupDto,
UpdateFeatureDto,
} from '../../proxy/feature-management/models';
enum ValueTypes {
ToggleStringValueType = 'ToggleStringValueType',
@ -27,9 +31,9 @@ export class FeatureManagementComponent
@Input()
providerName: string;
selectedGroup: string;
selectedGroupDisplayName: string;
groups: string[] = [];
groups: Pick<FeatureGroupDto, 'name' | 'displayName'>[] = [];
features: {
[group: string]: Array<FeatureDto & { style?: { [key: string]: number }; initialValue: any }>;
@ -68,8 +72,8 @@ export class FeatureManagementComponent
getFeatures() {
this.service.get(this.providerName, this.providerKey).subscribe(res => {
this.groups = res.groups.map(group => group.displayName);
this.selectedGroup = this.groups[0];
this.groups = res.groups.map(({ name, displayName }) => ({ name, displayName }));
this.selectedGroupDisplayName = this.groups[0].displayName;
this.features = res.groups.reduce(
(acc, val) => ({
...acc,

4
npm/ng-packs/packages/schematics/src/commands/api/files-service/proxy/__namespace@dir__/__name@kebab__.service.ts.template

@ -10,7 +10,9 @@ export class <%= name %>Service {
<%= camel(signature.name) %> = (<%= serializeParameters(signature.parameters) %>) =>
this.restService.request<<%= body.requestType %>, <%= body.responseType %>>({
method: '<%= body.method %>',
method: '<%= body.method %>',<%
if (body.responseType === 'string') { %>
responseType: 'text',<% } %>
url: `/<%= body.url %>`,<%
if (body.params.length) { %>
params: { <%= body.params.join(', ') %> },<% }

99
npm/ng-packs/yarn.lock

@ -266,6 +266,19 @@
rxjs "6.4.0"
source-map "0.7.3"
"@angular-devkit/schematics-cli@^0.1001.1":
version "0.1001.1"
resolved "https://registry.yarnpkg.com/@angular-devkit/schematics-cli/-/schematics-cli-0.1001.1.tgz#b4ff180e7b5134928d1588c2cf2f7350296d4a0f"
integrity sha512-VkmbbI8boHwUNO1JEv0GPEzddScvrNu1ZEIhX6++M7s58sVbdIQhE2zX2MpFOQfUBCPtJXmWPUuXEcMsbKzQ2g==
dependencies:
"@angular-devkit/core" "10.1.1"
"@angular-devkit/schematics" "10.1.1"
"@schematics/schematics" "0.1001.1"
inquirer "7.3.3"
minimist "1.2.5"
rxjs "6.6.2"
symbol-observable "1.2.0"
"@angular-devkit/schematics@10.0.8", "@angular-devkit/schematics@~10.0.3":
version "10.0.8"
resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-10.0.8.tgz#6064d6323a1c9abc195e67ae4c88e373ce36b5e2"
@ -275,6 +288,15 @@
ora "4.0.4"
rxjs "6.5.5"
"@angular-devkit/schematics@10.1.1":
version "10.1.1"
resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-10.1.1.tgz#70e3ff6c25047f4d97d3eb61912e5d1e245b022a"
integrity sha512-4UrBbDkuzGmBN1YDG3+GBJ21C+X29vxO0k2EDGrFFjQROsDeogeyWJoUP789v4JCCz9DHF2TRmdhQiEBctZXMg==
dependencies:
"@angular-devkit/core" "10.1.1"
ora "5.0.0"
rxjs "6.6.2"
"@angular-devkit/schematics@^8.0.6":
version "8.3.29"
resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-8.3.29.tgz#b3ba658b90fb3226a80ff12977be7dd583e99c49"
@ -2564,6 +2586,14 @@
"@angular-devkit/core" "10.0.8"
"@angular-devkit/schematics" "10.0.8"
"@schematics/schematics@0.1001.1":
version "0.1001.1"
resolved "https://registry.yarnpkg.com/@schematics/schematics/-/schematics-0.1001.1.tgz#7760dffad188fbc69b9615c2e1f42d9f3c1ab6f3"
integrity sha512-dPL2XTad83vDczKk+p1Jd7mEOoU7CTrBL8+JmXHsVL++58hmoVppm2NyBmdDsFSCL8Sw8/J8UWp/0lJRXM6lqw==
dependencies:
"@angular-devkit/core" "10.1.1"
"@angular-devkit/schematics" "10.1.1"
"@schematics/update@0.1000.8":
version "0.1000.8"
resolved "https://registry.yarnpkg.com/@schematics/update/-/update-0.1000.8.tgz#3b745ec14e92cfd1f7d16f9a4c3864e1f12249c9"
@ -4136,9 +4166,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001032, caniuse-lite@^1.0.30001061, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001125:
version "1.0.30001129"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001129.tgz#e6514b94c0ef50f98cf7476daa91228ddd2ef7bc"
integrity sha512-9945fTVKS810DZITpsAbuhQG7Lam0tEfVbZlsBaCFZaszepbryrArS05PWmJSBQ6mta+v9iz0pUIAbW1eBILIg==
version "1.0.30001131"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001131.tgz#afad8a28fc2b7a0d3ae9407e71085a0ead905d54"
integrity sha512-4QYi6Mal4MMfQMSqGIRPGbKIbZygeN83QsWq1ixpUwvtfgAZot5BrCKzGygvZaV+CnELdTwD0S4cqUNozq7/Cw==
canonical-path@1.0.0:
version "1.0.0"
@ -4157,7 +4187,7 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
chalk@4.1.0, chalk@^4.0.0:
chalk@4.1.0, chalk@^4.0.0, chalk@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
@ -4319,7 +4349,7 @@ cli-cursor@^3.1.0:
dependencies:
restore-cursor "^3.1.0"
cli-spinners@^2.0.0, cli-spinners@^2.2.0:
cli-spinners@^2.0.0, cli-spinners@^2.2.0, cli-spinners@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.4.0.tgz#c6256db216b878cfba4720e719cec7cf72685d7f"
integrity sha512-sJAofoarcm76ZGpuooaO0eDy8saEy+YoZBLjC4h8srt4jeBnkYeOgqxgsJQTpyt2LjI5PTfLJHSL+41Yu4fEJA==
@ -4329,6 +4359,11 @@ cli-width@^2.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==
cli-width@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6"
integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==
cliui@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5"
@ -5672,9 +5707,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.564:
version "1.3.567"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.567.tgz#7a404288952ac990e447a7a86470d460ea953b8f"
integrity sha512-1aKkw0Hha1Bw9JA5K5PT5eFXC/TXbkJvUfNSNEciPUMgSIsRJZM1hF2GUEAGZpAbgvd8En21EA+Lv820KOhvqA==
version "1.3.568"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.568.tgz#0fa28cd3e5cbd9e8c66f72309eef0646f65a5b66"
integrity sha512-j9MlEwgTHVW/lq93Hw8yhzA886oLjDm3Hz7eDkWP2v4fzLVuqOWhpNluziSnmR/tBqgoYldagbLknrdg+B7Tlw==
elliptic@^6.5.3:
version "6.5.3"
@ -5863,9 +5898,9 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3:
ext "^1.1.2"
escalade@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.0.2.tgz#6a580d70edb87880f22b4c91d0d56078df6962c4"
integrity sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==
version "3.1.0"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.0.tgz#e8e2d7c7a8b76f6ee64c2181d6b8151441602d4e"
integrity sha512-mAk+hPSO8fLDkhV7V0dXazH5pDc6MrjBTPyD3VeKzxnVFjH1MIxbCdqGZB9O8+EwWakZs3ZCbDS4IpRt79V1ig==
escape-html@~1.0.3:
version "1.0.3"
@ -7370,6 +7405,25 @@ inquirer@7.1.0:
strip-ansi "^6.0.0"
through "^2.3.6"
inquirer@7.3.3:
version "7.3.3"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003"
integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==
dependencies:
ansi-escapes "^4.2.1"
chalk "^4.1.0"
cli-cursor "^3.1.0"
cli-width "^3.0.0"
external-editor "^3.0.3"
figures "^3.0.0"
lodash "^4.17.19"
mute-stream "0.0.8"
run-async "^2.4.0"
rxjs "^6.6.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
through "^2.3.6"
internal-ip@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907"
@ -8750,6 +8804,13 @@ log-symbols@^3.0.0:
dependencies:
chalk "^2.4.2"
log-symbols@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920"
integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==
dependencies:
chalk "^4.0.0"
loglevel@^1.6.8:
version "1.7.0"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.0.tgz#728166855a740d59d38db01cf46f042caa041bb0"
@ -9901,6 +9962,20 @@ ora@4.0.4:
strip-ansi "^6.0.0"
wcwidth "^1.0.1"
ora@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/ora/-/ora-5.0.0.tgz#4f0b34f2994877b49b452a707245ab1e9f6afccb"
integrity sha512-s26qdWqke2kjN/wC4dy+IQPBIMWBJlSU/0JZhk30ZDBLelW25rv66yutUWARMigpGPzcXHb+Nac5pNhN/WsARw==
dependencies:
chalk "^4.1.0"
cli-cursor "^3.1.0"
cli-spinners "^2.4.0"
is-interactive "^1.0.0"
log-symbols "^4.0.0"
mute-stream "0.0.8"
strip-ansi "^6.0.0"
wcwidth "^1.0.1"
ora@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/ora/-/ora-3.4.0.tgz#bf0752491059a3ef3ed4c85097531de9fdbcd318"
@ -11662,7 +11737,7 @@ rxjs@6.6.2:
dependencies:
tslib "^1.9.0"
rxjs@^6.4.0, rxjs@^6.5.0, rxjs@^6.5.2, rxjs@^6.5.3:
rxjs@^6.4.0, rxjs@^6.5.0, rxjs@^6.5.2, rxjs@^6.5.3, rxjs@^6.6.0:
version "6.6.3"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552"
integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj

@ -19,6 +19,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor\Volo.Abp.Identity.Blazor.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Blazor\Volo.Abp.Account.Blazor.csproj" />
</ItemGroup>
<ItemGroup>

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs

@ -14,14 +14,16 @@ using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.Identity.Blazor;
using Volo.Abp.Account.Blazor;
namespace MyCompanyName.MyProjectName.Blazor
{
[DependsOn(
typeof(AbpAutofacWebAssemblyModule),
typeof(MyProjectNameHttpApiClientModule),
typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule),
typeof(AbpIdentityBlazorModule),
typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule)
typeof(AbpAccountBlazorModule)
)]
public class MyProjectNameBlazorModule : AbpModule
{

5
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameMenuContributor.cs

@ -8,6 +8,11 @@ namespace MyCompanyName.MyProjectName.Blazor
{
public Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if(context.Menu.DisplayName != StandardMenus.Main)
{
return Task.CompletedTask;
}
var l = context.GetLocalizer<MyProjectNameResource>();
context.Menu.Items.Insert(

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj

@ -20,6 +20,7 @@
<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" />

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/Program.cs

@ -22,8 +22,8 @@ namespace MyCompanyName.MyProjectName.DbMigrator
.MinimumLevel.Override("MyCompanyName.MyProjectName", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.WriteTo.File(Path.Combine(Directory.GetCurrentDirectory(), "Logs/logs.txt"))
.WriteTo.Console()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
await CreateHostBuilder(args).RunConsoleAsync();

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -11,7 +11,6 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" />

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs

@ -19,6 +19,9 @@ namespace MyCompanyName.MyProjectName
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj

@ -11,7 +11,6 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" />

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs

@ -19,6 +19,9 @@ namespace MyCompanyName.MyProjectName
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj

@ -33,7 +33,6 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" />

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs

@ -19,6 +19,9 @@ namespace MyCompanyName.MyProjectName
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

46
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MongoDbMyProjectNameDbSchemaMigrator.cs

@ -0,0 +1,46 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Driver;
using MyCompanyName.MyProjectName.Data;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MongoDB;
namespace MyCompanyName.MyProjectName.MongoDB
{
public class MongoDbMyProjectNameDbSchemaMigrator : IMyProjectNameDbSchemaMigrator , ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public MongoDbMyProjectNameDbSchemaMigrator(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
}
public Task MigrateAsync()
{
var dbContexts = _serviceProvider.GetServices<IAbpMongoDbContext>();
var connectionStringResolver = _serviceProvider.GetService<IConnectionStringResolver>();
foreach (var dbContext in dbContexts)
{
var connectionString =
connectionStringResolver.Resolve(
ConnectionStringNameAttribute.GetConnStringName(dbContext.GetType()));
var mongoUrl = new MongoUrl(connectionString);
var databaseName = mongoUrl.DatabaseName;
var client = new MongoClient(mongoUrl);
if (databaseName.IsNullOrWhiteSpace())
{
databaseName = ConnectionStringNameAttribute.GetConnStringName(dbContext.GetType());
}
(dbContext as AbpMongoDbContext)?.InitializeCollections(client.GetDatabase(databaseName));
}
return Task.CompletedTask;
}
}
}

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj

@ -17,7 +17,6 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.6" />

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs

@ -20,6 +20,9 @@ namespace MyCompanyName.MyProjectName.Web
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj

@ -33,7 +33,6 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" />

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs

@ -20,6 +20,9 @@ namespace MyCompanyName.MyProjectName.Web
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

8
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace MyCompanyName.MyProjectName.MongoDB
{
@ -12,7 +13,7 @@ namespace MyCompanyName.MyProjectName.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MyProjectNameMongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MyProjectNameMongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
@ -20,6 +21,11 @@ namespace MyCompanyName.MyProjectName.MongoDB
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}

2
templates/console/src/MyCompanyName.MyProjectName/Program.cs

@ -21,7 +21,7 @@ namespace MyCompanyName.MyProjectName
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Console()
.WriteTo.Async(c => c.Console())
.CreateLogger();
try

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="IdentityModel" Version="4.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" />

5
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs

@ -19,7 +19,10 @@ namespace MyCompanyName.MyProjectName
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj

@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" />

5
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs

@ -19,7 +19,10 @@ namespace MyCompanyName.MyProjectName
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj

@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.6" />

5
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs

@ -19,7 +19,10 @@ namespace MyCompanyName.MyProjectName
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj

@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />

5
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs

@ -15,7 +15,10 @@ namespace MyCompanyName.MyProjectName
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try

12
templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MyProjectNameMongoDbTestModule.cs

@ -1,6 +1,7 @@
using System;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace MyCompanyName.MyProjectName.MongoDB
{
@ -12,14 +13,19 @@ namespace MyCompanyName.MyProjectName.MongoDB
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
}
}
}

Loading…
Cancel
Save