diff --git a/abp_io/src/Volo.AbpWebSite.Web/AbpWebSiteWebModule.cs b/abp_io/src/Volo.AbpWebSite.Web/AbpWebSiteWebModule.cs index 8031142779..81105447fc 100644 --- a/abp_io/src/Volo.AbpWebSite.Web/AbpWebSiteWebModule.cs +++ b/abp_io/src/Volo.AbpWebSite.Web/AbpWebSiteWebModule.cs @@ -1,5 +1,4 @@ using System.IO; -using System.Linq; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; @@ -14,7 +13,6 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theming; -using Volo.Abp.Authorization.Permissions; using Volo.Abp.Autofac; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; @@ -182,18 +180,8 @@ namespace Volo.AbpWebSite AsyncHelper.RunSync(async () => { await scope.ServiceProvider - .GetRequiredService() - .SeedAsync( - "1q2w3E*" - ); - - await scope.ServiceProvider - .GetRequiredService() - .SeedAsync( - RolePermissionValueProvider.ProviderName, - "admin", - IdentityPermissions.GetAll().Union(BloggingPermissions.GetAll()) - ); + .GetRequiredService() + .SeedAsync(); }); } } diff --git a/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/HomePageLayout.cshtml b/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/HomePageLayout.cshtml index c0b7a79b7c..a4c25f8a7b 100644 --- a/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/HomePageLayout.cshtml +++ b/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/HomePageLayout.cshtml @@ -17,7 +17,7 @@ @(ViewBag.Title == null ? "abp.io" : ViewBag.Title) @await Component.InvokeAsync(typeof(StandardMetaViewComponent)) - @RenderSection("styles", false) + @await RenderSectionAsync("styles", false) @@ -47,7 +47,7 @@ gtag('config', 'UA-49982725-4'); - @RenderSection("scripts", false) + @await RenderSectionAsync("scripts", false) \ No newline at end of file diff --git a/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/Layout.cshtml b/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/Layout.cshtml index 4fb93a6955..064008d0d6 100644 --- a/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/Layout.cshtml +++ b/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/Layout.cshtml @@ -17,7 +17,7 @@ @(ViewBag.Title == null ? "abp.io" : ViewBag.Title) @await Component.InvokeAsync(typeof(StandardMetaViewComponent)) - @RenderSection("styles", false) + @await RenderSectionAsync("styles", false) @@ -58,7 +58,7 @@ gtag('config', 'UA-49982725-4'); - @RenderSection("scripts", false) + @await RenderSectionAsync("scripts", false) \ No newline at end of file diff --git a/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/LayoutEmpty.cshtml b/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/LayoutEmpty.cshtml index 99ee20dacf..f3769b34aa 100644 --- a/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/LayoutEmpty.cshtml +++ b/abp_io/src/Volo.AbpWebSite.Web/Pages/Shared/LayoutEmpty.cshtml @@ -18,7 +18,7 @@ @(ViewBag.Title == null ? "abp.io" : ViewBag.Title) @await Component.InvokeAsync(typeof(StandardMetaViewComponent)) - @RenderSection("styles", false) + @await RenderSectionAsync("styles", false) @@ -41,7 +41,7 @@ gtag('config', 'UA-49982725-4'); - @RenderSection("scripts", false) + @await RenderSectionAsync("scripts", false) \ No newline at end of file diff --git a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/NugetReferenceReplaceStep.cs b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/NugetReferenceReplaceStep.cs index 25cdbc988e..b32d747fc0 100644 --- a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/NugetReferenceReplaceStep.cs +++ b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/NugetReferenceReplaceStep.cs @@ -16,7 +16,8 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps new NugetReferenceReplacer( context.Files, "MyCompanyName", - "MyProjectName" + "MyProjectName", + context.Template.Version ).Run(); } @@ -27,12 +28,12 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps private readonly string _projectNamePlaceHolder; private readonly string _latestNugetPackageVersion; - public NugetReferenceReplacer(List entries, string companyNamePlaceHolder, string projectNamePlaceHolder) + public NugetReferenceReplacer(List entries, string companyNamePlaceHolder, string projectNamePlaceHolder, string latestNugetPackageVersion) { _entries = entries; _companyNamePlaceHolder = companyNamePlaceHolder; _projectNamePlaceHolder = projectNamePlaceHolder; - _latestNugetPackageVersion = GetLatestNugetPackageVersion(); + _latestNugetPackageVersion = latestNugetPackageVersion; } public void Run() @@ -110,38 +111,6 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps stream.Position = 0; return stream; } - - private string GetLatestNugetPackageVersion() - { - //TODO: This should get it from the related release! Not always from the master! - - var commonPropsUrl = "https://raw.githubusercontent.com/abpframework/abp/master/common.props"; - var content = ""; - using (var webClient = new WebClient()) - { - try - { - content = webClient.DownloadString(commonPropsUrl); - } - catch (Exception) - { - throw new Exception("The Common.pros doesn't exist on github or removed to anywhere else."); - } - } - - var doc = new HtmlDocument(); - - doc.Load(GenerateStreamFromString(content)); - - try - { - return doc.DocumentNode.SelectNodes("//version").FirstOrDefault().InnerHtml.Trim(); - } - catch (Exception e) - { - return ""; - } - } } } } diff --git a/build-all.ps1 b/build-all.ps1 index 907f6816bf..8393efd9fb 100644 --- a/build-all.ps1 +++ b/build-all.ps1 @@ -18,6 +18,7 @@ $solutionPaths = ( "modules/blogging", "modules/audit-logging", "modules/background-jobs", + "modules/client-simulation", "abp_io", "templates/module", "templates/service", diff --git a/docs/en/Contribution/Index.md b/docs/en/Contribution/Index.md index 67fbc4ce96..74174c97d1 100644 --- a/docs/en/Contribution/Index.md +++ b/docs/en/Contribution/Index.md @@ -49,4 +49,4 @@ If you decide to create some tutorials or blog posts on ABP, please inform us (b ### Bug Report -If you find any bug, please [create an issue on the Github repository](https://github.com/abpframework/abp/issues/new). \ No newline at end of file +If you find any bug, please [create an issue on the Github repository](https://github.com/abpframework/abp/issues/new). diff --git a/docs/en/Multi-Tenancy.md b/docs/en/Multi-Tenancy.md index d8c52f38fe..118fea5c19 100644 --- a/docs/en/Multi-Tenancy.md +++ b/docs/en/Multi-Tenancy.md @@ -6,17 +6,17 @@ Wikipedia [defines](https://en.wikipedia.org/wiki/Multitenancy) multi-tenancy as > Software **Multi-tenancy** refers to a software **architecture** in which a **single instance** of a software runs on a server and serves **multiple tenants**. A tenant is a group of users who share a common access with specific privileges to the software instance. With a multitenant architecture, a software application is designed to provide every tenant a **dedicated share of the instance including its data**, configuration, user management, tenant individual functionality and non-functional properties. Multi-tenancy contrasts with multi-instance architectures, where separate software instances operate on behalf of different tenants. -### Volo.Abp.MultiTenancy.Abstractions Package +### Volo.Abp.MultiTenancy Package -Volo.Abp.MultiTenancy.Abstractions package defines fundamental interfaces to make your code "multi-tenancy ready". So, install it to your project using the package manager console (PMC): +Volo.Abp.MultiTenancy package defines fundamental interfaces to make your code "multi-tenancy ready". So, install it to your project using the package manager console (PMC): ```` -Install-Package Volo.Abp.MultiTenancy.Abstractions +Install-Package Volo.Abp.MultiTenancy ```` > This package is already installed by default with the startup template. So, most of the time, you don't need to install it manually. -Then you can add **AbpMultiTenancyAbstractionsModule** dependency to your module: +Then you can add **AbpMultiTenancyModule** dependency to your module: ````C# using Volo.Abp.Modularity; @@ -24,7 +24,7 @@ using Volo.Abp.MultiTenancy; namespace MyCompany.MyProject { - [DependsOn(typeof(AbpMultiTenancyAbstractionsModule))] + [DependsOn(typeof(AbpMultiTenancyModule))] public class MyModule : AbpModule { //... @@ -98,7 +98,7 @@ Volo.Abp.MultiTenancy is the actual package that makes your application multi-te Install-Package Volo.Abp.MultiTenancy ```` -Then you can add **AbpMultiTenancyAbstractionsModule** dependency to your module: +Then you can add **AbpMultiTenancyModule** dependency to your module: ````C# using Volo.Abp.Modularity; @@ -114,7 +114,7 @@ namespace MyCompany.MyProject } ```` -> If you add AbpMultiTenancyModule dependency to your module, then you don't need to add AbpMultiTenancyAbstractionsModule dependency separately since AbpMultiTenancyModule already depends on it. +> If you add AbpMultiTenancyModule dependency to your module, then you don't need to add AbpMultiTenancyModule dependency separately since AbpMultiTenancyModule already depends on it. #### Determining Current Tenant diff --git a/docs/en/Nightly-Builds.md b/docs/en/Nightly-Builds.md new file mode 100644 index 0000000000..e7ebe0f33b --- /dev/null +++ b/docs/en/Nightly-Builds.md @@ -0,0 +1,26 @@ +# Nightly Builds + +All framework & module packages are deployed to MyGet every night in weekdays. So, you can use or test the latest code without waiting the next release. + +## Configure Visual Studio + +> Requires Visual Studio 2017+ + +1. Go to `Tools > Options > NuGet Package Manager > Package Source`. +2. Click the green `+` icon. +3. Set `ABP Nightly` as *Name* and `https://www.myget.org/F/abp-nightly/api/v3/index.json` as the *Source* as shown below: + ![night-build-add-nuget-source](images/night-build-add-nuget-source.png) +4. Click the `Update` button. +5. Click the `OK` button to save changes. + +## Install Package + +Now, you can install preview / nightly packages to your project from Nuget Browser or Package Manager Console. + +![night-build-add-nuget-package](images/night-build-add-nuget-package.png) + +1. In the nuget browser, select "Include prereleases". +2. Change package source to "All". +3. Search a package. You will see prereleases of the package formatted as `(VERSION)-preview(DATE)` (like *v0.16.0-preview20190401* in this sample). +4. You can click to the `Install` button to add package to your project. + diff --git a/docs/en/Samples/Microservice-Demo.md b/docs/en/Samples/Microservice-Demo.md index 55a60dca89..4edebfbe03 100644 --- a/docs/en/Samples/Microservice-Demo.md +++ b/docs/en/Samples/Microservice-Demo.md @@ -116,11 +116,29 @@ To be able to run the solution from source code, following tools should be insta * Run `dotnet restore` from the command line inside the `samples\MicroserviceDemo` folder. * Build the solution in Visual Studio. -#### Restore Databases +#### Create Databases -Open `MsDemo_Identity.zip` and `MsDemo_ProductManagement.zip` inside the `samples\MicroserviceDemo\databases` folder and restore to the SQL Server. +MongoDB database is created dynamically, however you need to create database schemas for SQL server databases. The solution is configured to use Entity Core Code First migrations, so you can easily create databases. -> Notice that: These databases have EF Core migrations in the solution, however they don't have seed data, especially required for IdentityServer4 configuration. So, restoring the databases is much more easier. +There are two SQL server databases in this solution. + +##### MsDemo_Identity Database + +* Right click to the `AuthServer.Host` project and click to the `Set as startup project`. +* Open the **Package Manager Console** (Tools -> Nuget Package Manager -> Package Manager Console) +* Select `AuthServer.Host` as the **Default project**. +* Run `Update-Database` command. + +![microservice-sample-update-database-authserver](../images/microservice-sample-update-database-authserver.png) + +##### MsDemo_ProductManagement + +- Right click to the `ProductService.Host` project and click to the `Set as startup project`. +- Open the **Package Manager Console** (Tools -> Nuget Package Manager -> Package Manager Console) +- Select `ProductService.Host` as the **Default project**. +- Run `Update-Database` command. + +![microservice-sample-update-database-products](../images/microservice-sample-update-database-products.png) #### Run Projects @@ -136,6 +154,8 @@ Run the projects with the following order (right click to each project, set as s * BackendAdminApp.Host * PublicWebSite.Host +When you run projects, they will add some initial demo data to their databases. + ## A Brief Overview of the Solution The Visual Studio solution consists of multiple projects each have different roles in the system: diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 905821c73a..396b92afd3 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -276,6 +276,10 @@ { "text": "Testing" }, + { + "text": "Nightly Builds", + "path": "Nightly-Builds.md" + }, { "text": "Contribution Guide", "path": "Contribution/Index.md" diff --git a/docs/en/images/microservice-sample-update-database-authserver.png b/docs/en/images/microservice-sample-update-database-authserver.png new file mode 100644 index 0000000000..689019b587 Binary files /dev/null and b/docs/en/images/microservice-sample-update-database-authserver.png differ diff --git a/docs/en/images/microservice-sample-update-database-products.png b/docs/en/images/microservice-sample-update-database-products.png new file mode 100644 index 0000000000..b49c2a8f8e Binary files /dev/null and b/docs/en/images/microservice-sample-update-database-products.png differ diff --git a/docs/en/images/night-build-add-nuget-package.png b/docs/en/images/night-build-add-nuget-package.png new file mode 100644 index 0000000000..c3621ef7d9 Binary files /dev/null and b/docs/en/images/night-build-add-nuget-package.png differ diff --git a/docs/en/images/night-build-add-nuget-source.png b/docs/en/images/night-build-add-nuget-source.png new file mode 100644 index 0000000000..8fd4b9365a Binary files /dev/null and b/docs/en/images/night-build-add-nuget-source.png differ diff --git a/docs/zh-Hans/Multi-Tenancy.md b/docs/zh-Hans/Multi-Tenancy.md index 11b729e79f..6364428ec1 100644 --- a/docs/zh-Hans/Multi-Tenancy.md +++ b/docs/zh-Hans/Multi-Tenancy.md @@ -6,17 +6,17 @@ ABP的多租户模块提供了创建多租户应用程序的基本功能. > 软件多租户技术指的是一种软件架构,这种架构可以使用软件的单实例运行并为多个租户提供服务.租户是通过软件实例的特定权限共享通用访问的一组用户.使用多租户架构,软件应用为每个租户提供实例的专用共享,包括实例的数据、配置、用户管理、租户的私有功能和非功能属性.多租户与多实例架构形成对比,将软件实例的行为根据不同的租户分割开来. -### Volo.Abp.MultiTenancy.Abstractions +### Volo.Abp.MultiTenancy -Volo.Abp.MultiTenancy.Abstractions定义了一些基础接口让你的代码"multi-tenancy ready",使用包管理器控制台(PMC)将它安装到你的项目中: +Volo.Abp.MultiTenancy"multi-tenancy ready",使用包管理器控制台(PMC)将它安装到你的项目中: ```` -Install-Package Volo.Abp.MultiTenancy.Abstractions +Install-Package Volo.Abp.MultiTenancy ```` > 这个包默认安装在了快速启动模板中.所以,大多数情况下,你不需要手动安装它. -然后你可以添加 **AbpMultiTenancyAbstractionsModule** 依赖到你的模块: +然后你可以添加 **AbpMultiTenancyModule** 依赖到你的模块: ````C# using Volo.Abp.Modularity; @@ -24,7 +24,7 @@ using Volo.Abp.MultiTenancy; namespace MyCompany.MyProject { - [DependsOn(typeof(AbpMultiTenancyAbstractionsModule))] + [DependsOn(typeof(AbpMultiTenancyModule))] public class MyModule : AbpModule { //... @@ -98,7 +98,7 @@ Volo.Abp.MultiTenancy 才是让你的程序实现多租户的真正的包.使用 Install-Package Volo.Abp.MultiTenancy ```` -然后添加 **AbpMultiTenancyAbstractionsModule** 依赖到你的模块中: +然后添加 **AbpMultiTenancyModule** 依赖到你的模块中: ````C# using Volo.Abp.Modularity; @@ -114,7 +114,7 @@ namespace MyCompany.MyProject } ```` -> 如果你添加了AbpMultiTenancyModule依赖,就不需要再另外添加AbpMultiTenancyAbstractionsModule依赖了,因为AbpMultiTenancyModule已经依赖它了. +> 如果你添加了AbpMultiTenancyModule依赖,就不需要再另外添加AbpMultiTenancyModule依赖了,因为AbpMultiTenancyModule已经依赖它了. #### 确定当前租户 diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpContextTenantResolveResultAccessor.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpContextTenantResolveResultAccessor.cs index 4865489248..6c44195b1a 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpContextTenantResolveResultAccessor.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/HttpContextTenantResolveResultAccessor.cs @@ -1,13 +1,12 @@ -using JetBrains.Annotations; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; namespace Volo.Abp.AspNetCore.MultiTenancy { + [Dependency(ReplaceServices = true)] public class HttpContextTenantResolveResultAccessor : ITenantResolveResultAccessor, ITransientDependency { - [CanBeNull] public TenantResolveResult Result { get diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancyOptionsExtensions.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancyOptionsExtensions.cs index a162f1750e..4b473cbf38 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancyOptionsExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancyOptionsExtensions.cs @@ -8,7 +8,7 @@ namespace Volo.Abp.MultiTenancy public static void AddDomainTenantResolver(this TenantResolveOptions options, string domainFormat) { options.TenantResolvers.InsertAfter( - r => r is CurrentClaimsPrincipalTenantResolveContributor, + r => r is CurrentUserTenantResolveContributor, new DomainTenantResolveContributor(domainFormat) ); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/pt-BR.json b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/pt-BR.json index 3c1cb1f82d..2acb0a275b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/pt-BR.json +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/pt-BR.json @@ -1,9 +1,11 @@ { "culture": "pt-BR", "texts": { - "GivenTenantIsNotAvailable": "Tenant não está disponível: {0}", - "SwitchTenant": "Trocar tenant", + "GivenTenantIsNotAvailable": "Inquilino não está disponível: {0}", + "Tenant": "Inquilino", + "Switch": "trocar", "Name": "Nome", - "SwitchTenantHint": "Deixe o campo de nome em branco para alternar para o lado do host." + "SwitchTenantHint": "Deixe o campo de nome em branco para alternar para o lado do host.", + "NotSelected": "Não selecionado" } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs index 08d04cfed2..d6e4935321 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs @@ -1,4 +1,5 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Toolbars; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; @@ -11,7 +12,8 @@ using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic { [DependsOn( - typeof(AbpAspNetCoreMvcUiThemeSharedModule) + typeof(AbpAspNetCoreMvcUiThemeSharedModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule) )] public class AbpAspNetCoreMvcUiBasicThemeModule : AbpModule { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml index 7bfe8f1730..cace550248 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml @@ -7,7 +7,7 @@ var disabled = menuItem.IsDisabled ? "disabled" : string.Empty; if (menuItem.IsLeaf) { - @if (menuItem.Url != null) + if (menuItem.Url != null) {