The Startup Project
See the documentation to understand how to run the downloaded project.
diff --git a/abp_io/src/Volo.AbpWebSite.Web/Templates/MvcApplicationTemplate.cs b/abp_io/src/Volo.AbpWebSite.Web/Templates/MvcApplicationTemplate.cs
index 6868720b20..63e81a7b25 100644
--- a/abp_io/src/Volo.AbpWebSite.Web/Templates/MvcApplicationTemplate.cs
+++ b/abp_io/src/Volo.AbpWebSite.Web/Templates/MvcApplicationTemplate.cs
@@ -37,6 +37,7 @@ namespace Volo.AbpWebSite.Templates
if (context.Request.DatabaseProvider != DatabaseProvider.EntityFrameworkCore)
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore"));
+ steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Application.Tests", projectFolderPath: "test/MyCompanyName.MyProjectName.Application.Tests"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Tests", projectFolderPath: "test/MyCompanyName.MyProjectName.Web.Tests"));
}
diff --git a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/ProjectBuildContextExtensions.cs b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/ProjectBuildContextExtensions.cs
new file mode 100644
index 0000000000..2aa568ba20
--- /dev/null
+++ b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/ProjectBuildContextExtensions.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Linq;
+using Volo.Utils.SolutionTemplating.Files;
+
+namespace Volo.Utils.SolutionTemplating.Building
+{
+ public static class ProjectBuildContextExtensions
+ {
+ public static FileEntry GetFile(this ProjectBuildContext context, string filePath)
+ {
+ var file = context.Files.FirstOrDefault(f => f.Name == filePath);
+ if (file == null)
+ {
+ throw new ApplicationException("Could not find file: " + filePath);
+ }
+
+ return file;
+ }
+ }
+}
\ No newline at end of file
diff --git a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/ProjectBuildPipelineStep.cs b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/ProjectBuildPipelineStep.cs
index 7a94ca6ee1..ed6f613dbf 100644
--- a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/ProjectBuildPipelineStep.cs
+++ b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/ProjectBuildPipelineStep.cs
@@ -1,22 +1,7 @@
-using System;
-using System.Linq;
-using Volo.Utils.SolutionTemplating.Files;
-
-namespace Volo.Utils.SolutionTemplating.Building
+namespace Volo.Utils.SolutionTemplating.Building
{
public abstract class ProjectBuildPipelineStep
{
public abstract void Execute(ProjectBuildContext context);
-
- protected FileEntry GetFile(ProjectBuildContext context, string filePath)
- {
- var file = context.Files.FirstOrDefault(f => f.Name == filePath);
- if (file == null)
- {
- throw new ApplicationException("Could not find file: " + filePath);
- }
-
- return file;
- }
}
}
\ No newline at end of file
diff --git a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/RemoveProjectFromSolutionStep.cs b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/RemoveProjectFromSolutionStep.cs
index 41e9b2cd26..eb56699547 100644
--- a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/RemoveProjectFromSolutionStep.cs
+++ b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/RemoveProjectFromSolutionStep.cs
@@ -23,7 +23,7 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps
public override void Execute(ProjectBuildContext context)
{
context.Files.RemoveAll(file => file.Name.StartsWith(_projectFolderPath));
- var solutionFile = GetFile(context, _solutionFilePath);
+ var solutionFile = context.GetFile(_solutionFilePath);
solutionFile.NormalizeLineEndings();
solutionFile.SetLines(RemoveProject(solutionFile.GetLines().ToList()));
}
diff --git a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/SwitchEntityFrameworkCoreToMongoDbStep.cs b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/SwitchEntityFrameworkCoreToMongoDbStep.cs
index cf7404eccf..0901d0250b 100644
--- a/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/SwitchEntityFrameworkCoreToMongoDbStep.cs
+++ b/abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/SwitchEntityFrameworkCoreToMongoDbStep.cs
@@ -14,7 +14,7 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps
private void ChangeProjectReference(ProjectBuildContext context)
{
- var file = GetFile(context, "/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj");
+ var file = context.GetFile("/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj");
file.NormalizeLineEndings();
@@ -29,12 +29,12 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps
}
}
- throw new ApplicationException("Could not find the 'Default' connection string in appsettings.json file!");
+ throw new ApplicationException("Could not find the EntityFrameworkCore reference in the MyCompanyName.MyProjectName.Web.csproj!");
}
private void ChangeWebModuleUsage(ProjectBuildContext context)
{
- var file = GetFile(context, "/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs");
+ var file = context.GetFile("/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs");
file.NormalizeLineEndings();
@@ -59,7 +59,7 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps
private void ChangeConnectionString(ProjectBuildContext context)
{
- var file = GetFile(context, "/src/MyCompanyName.MyProjectName.Web/appsettings.json");
+ var file = context.GetFile("/src/MyCompanyName.MyProjectName.Web/appsettings.json");
file.NormalizeLineEndings();
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs
index 0643620ec9..f769f512a5 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
+using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Features;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs
new file mode 100644
index 0000000000..02c97c0598
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteLanguageProvider.cs
@@ -0,0 +1,23 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.Localization;
+
+namespace Volo.Abp.AspNetCore.Mvc.Client
+{
+ public class RemoteLanguageProvider : ILanguageProvider, ITransientDependency
+ {
+ protected ICachedApplicationConfigurationClient ConfigurationClient { get; }
+
+ public RemoteLanguageProvider(ICachedApplicationConfigurationClient configurationClient)
+ {
+ ConfigurationClient = configurationClient;
+ }
+
+ public async Task
> GetLanguagesAsync()
+ {
+ var configuration = await ConfigurationClient.GetAsync();
+ return configuration.Localization.Languages;
+ }
+ }
+}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationFeatureConfigurationDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationFeatureConfigurationDto.cs
index 8917e3dcfa..4972d2242d 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationFeatureConfigurationDto.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationFeatureConfigurationDto.cs
@@ -1,9 +1,16 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
{
+ [Serializable]
public class ApplicationFeatureConfigurationDto
{
public Dictionary Values { get; set; }
+
+ public ApplicationFeatureConfigurationDto()
+ {
+ Values = new Dictionary();
+ }
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs
index 05b5d8c7a6..2667734537 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs
@@ -1,16 +1,21 @@
using System;
using System.Collections.Generic;
+using Volo.Abp.Localization;
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
{
[Serializable]
public class ApplicationLocalizationConfigurationDto
{
+ //TODO: Rename to Texts?
public Dictionary> Values { get; set; }
+ public List Languages { get; set; }
+
public ApplicationLocalizationConfigurationDto()
{
Values = new Dictionary>();
+ Languages = new List();
}
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs
index 44a00808f8..d038d64789 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs
@@ -1,5 +1,4 @@
-using Microsoft.Extensions.DependencyInjection;
-using Volo.Abp.Modularity;
+using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs
index 57a03d0d75..fb8619b60a 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs
@@ -1,5 +1,4 @@
-using Microsoft.Extensions.DependencyInjection;
-using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
+using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js
index bdb7976286..39199ccf93 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js
@@ -338,6 +338,23 @@
}
}
+ configuration.language = {
+ info: localize("PagerInfo"),
+ infoFiltered: localize("PagerInfoFiltered"),
+ infoEmpty: localize("PagerInfoEmpty"),
+ search: localize("PagerSearch"),
+ processing: localize("ProcessingWithThreeDot"),
+ loadingRecords: localize("LoadingWithThreeDot"),
+ lengthMenu: localize("PagerShowMenuEntries"),
+ emptyTable: localize("NoDataAvailableInDatatable"),
+ paginate: {
+ first: localize("PagerFirst"),
+ last: localize("PagerLast"),
+ previous: localize("PagerPrevious"),
+ next: localize("PagerNext")
+ }
+ };
+
configuration.dom = '<"dataTable_filters"f>rt<"row dataTable_footer"<"col-auto"l><"col-auto"i><"col"p>>';
return configuration;
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ILayoutManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/IPageLayout.cs
similarity index 100%
rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ILayoutManager.cs
rename to framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/IPageLayout.cs
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs
index 2ea9282a91..e6cfafdf48 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs
@@ -24,6 +24,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
private readonly ISettingProvider _settingProvider;
private readonly ISettingDefinitionManager _settingDefinitionManager;
private readonly IFeatureDefinitionManager _featureDefinitionManager;
+ private readonly ILanguageProvider _languageProvider;
public AbpApplicationConfigurationAppService(
IOptions localizationOptions,
@@ -33,7 +34,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
ICurrentUser currentUser,
ISettingProvider settingProvider,
SettingDefinitionManager settingDefinitionManager,
- IFeatureDefinitionManager featureDefinitionManager)
+ IFeatureDefinitionManager featureDefinitionManager,
+ ILanguageProvider languageProvider)
{
_serviceProvider = serviceProvider;
_abpAuthorizationPolicyProvider = abpAuthorizationPolicyProvider;
@@ -42,6 +44,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
_settingProvider = settingProvider;
_settingDefinitionManager = settingDefinitionManager;
_featureDefinitionManager = featureDefinitionManager;
+ _languageProvider = languageProvider;
_localizationOptions = localizationOptions.Value;
}
@@ -53,7 +56,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
{
Auth = await GetAuthConfigAsync(),
Features = await GetFeaturesConfigAsync(),
- Localization = GetLocalizationConfig(),
+ Localization = await GetLocalizationConfigAsync(),
CurrentUser = GetCurrentUser(),
Setting = await GetSettingConfigAsync()
};
@@ -87,10 +90,12 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
return authConfig;
}
- protected virtual ApplicationLocalizationConfigurationDto GetLocalizationConfig()
+ protected virtual async Task GetLocalizationConfigAsync()
{
var localizationConfig = new ApplicationLocalizationConfigurationDto();
+ localizationConfig.Languages.AddRange(await _languageProvider.GetLanguagesAsync());
+
foreach (var resource in _localizationOptions.Resources.Values)
{
var dictionary = new Dictionary();
@@ -104,8 +109,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
dictionary[localizedString.Name] = localizedString.Value;
}
- var resourceName = LocalizationResourceNameAttribute.GetName(resource.ResourceType);
- localizationConfig.Values[resourceName] = dictionary;
+ localizationConfig.Values[resource.ResourceName] = dictionary;
}
return localizationConfig;
@@ -133,10 +137,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
protected virtual async Task GetFeaturesConfigAsync()
{
- var result = new ApplicationFeatureConfigurationDto
- {
- Values = new Dictionary()
- };
+ var result = new ApplicationFeatureConfigurationDto();
foreach (var featureDefinition in _featureDefinitionManager.GetAll())
{
diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs
index cae652ad28..1ed2a7f78a 100644
--- a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs
+++ b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs
@@ -10,7 +10,6 @@ namespace Volo.Abp.BackgroundWorkers
)]
public class AbpBackgroundWorkersModule : AbpModule
{
-
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var options = context.ServiceProvider.GetRequiredService>().Value;
diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs
index 477b0c764b..f65683042b 100644
--- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs
+++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs
@@ -1,5 +1,4 @@
using System;
-using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Distributed;
@@ -70,11 +69,12 @@ namespace Volo.Abp.Caching
}
catch (Exception ex)
{
- if ((bool) hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
return null;
}
+
throw;
}
@@ -94,11 +94,14 @@ namespace Volo.Abp.Caching
try
{
- cachedBytes = await Cache.GetAsync(NormalizeKey(key), CancellationTokenProvider.FallbackToProvider(token));
+ cachedBytes = await Cache.GetAsync(
+ NormalizeKey(key),
+ CancellationTokenProvider.FallbackToProvider(token)
+ );
}
catch (Exception ex)
{
- if ((bool)hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
return null;
@@ -185,7 +188,7 @@ namespace Volo.Abp.Caching
}
catch (Exception ex)
{
- if ((bool) hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
return;
@@ -210,7 +213,7 @@ namespace Volo.Abp.Caching
}
catch (Exception ex)
{
- if ((bool)hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
return;
@@ -230,7 +233,7 @@ namespace Volo.Abp.Caching
}
catch (Exception ex)
{
- if ((bool) hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
return;
@@ -250,7 +253,7 @@ namespace Volo.Abp.Caching
}
catch (Exception ex)
{
- if ((bool)hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
return;
@@ -270,7 +273,7 @@ namespace Volo.Abp.Caching
}
catch (Exception ex)
{
- if ((bool) hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
}
@@ -289,7 +292,7 @@ namespace Volo.Abp.Caching
}
catch (Exception ex)
{
- if ((bool)hideErrors)
+ if (hideErrors == true)
{
Logger.LogException(ex, LogLevel.Warning);
return;
diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj b/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
index 243c94e66a..cf3cb85cd0 100644
--- a/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
+++ b/framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
@@ -19,6 +19,7 @@
+
diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
index 48865f38f2..3b2bbc7582 100644
--- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
+++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
@@ -1,16 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Authorization;
+using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
using Volo.Abp.Aspects;
using Volo.Abp.Auditing;
using Volo.Abp.Authorization;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Features;
using Volo.Abp.Guids;
+using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Settings;
@@ -21,8 +23,8 @@ using Volo.Abp.Validation;
namespace Volo.Abp.Application.Services
{
- public abstract class ApplicationService :
- IApplicationService,
+ public abstract class ApplicationService :
+ IApplicationService,
IAvoidDuplicateCrossCuttingConcerns,
IValidationEnabled,
IUnitOfWorkEnabled,
@@ -53,6 +55,22 @@ namespace Volo.Abp.Application.Services
public IFeatureChecker FeatureChecker { get; set; }
+ public IStringLocalizerFactory StringLocalizerFactory { get; set; }
+
+ public IStringLocalizer L => _localizer ?? (_localizer = StringLocalizerFactory.Create(LocalizationResource));
+ private IStringLocalizer _localizer;
+
+ protected Type LocalizationResource
+ {
+ get => _localizationResource;
+ set
+ {
+ _localizationResource = value;
+ _localizer = null;
+ }
+ }
+ private Type _localizationResource = typeof(DefaultResource);
+
protected IUnitOfWork CurrentUnitOfWork => UnitOfWorkManager?.Current;
protected ILogger Logger => _lazyLogger.Value;
diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs
index 8ce1332ecb..ef22197f8a 100644
--- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs
+++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/EditionFeatureValueProvider.cs
@@ -20,7 +20,7 @@ namespace Volo.Abp.Features
public override async Task GetOrNullAsync(FeatureDefinition feature)
{
- var editionId = PrincipalAccessor.Principal.FindEditionId();
+ var editionId = PrincipalAccessor.Principal?.FindEditionId();
if (editionId == null)
{
return null;
diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
index 10d2c98126..21f27cce49 100644
--- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
+++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Net.Http;
+using System.Net.Http.Headers;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
@@ -210,6 +212,9 @@ namespace Volo.Abp.Http.Client.DynamicProxying
//CorrelationId
requestMessage.Headers.Add(CorrelationIdOptions.HttpHeaderName, CorrelationIdProvider.Get());
+
+ //TODO: Is that the way we want? Couldn't send the culture (not ui culture)
+ requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(CultureInfo.CurrentUICulture.Name));
}
private string GetConfiguredApiVersion()
diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs
index c9428626a8..b1741d0ca0 100644
--- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs
+++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs
@@ -8,7 +8,7 @@ using Microsoft.Extensions.Localization;
namespace Volo.Abp.Localization
{
- public class AbpDictionaryBasedStringLocalizer : IStringLocalizer
+ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocalizerSupportsInheritance
{
public LocalizationResource Resource { get; }
@@ -26,7 +26,20 @@ namespace Volo.Abp.Localization
public IEnumerable GetAllStrings(bool includeParentCultures)
{
- return GetAllStrings(CultureInfo.CurrentUICulture.Name, includeParentCultures);
+ return GetAllStrings(
+ CultureInfo.CurrentUICulture.Name,
+ includeParentCultures
+ );
+ }
+
+
+ public IEnumerable GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers)
+ {
+ return GetAllStrings(
+ CultureInfo.CurrentUICulture.Name,
+ includeParentCultures,
+ includeBaseLocalizers
+ );
}
public IStringLocalizer WithCulture(CultureInfo culture)
@@ -109,26 +122,32 @@ namespace Volo.Abp.Localization
return null;
}
- protected virtual IReadOnlyList GetAllStrings(string cultureName, bool includeParentCultures = true)
+ protected virtual IReadOnlyList GetAllStrings(
+ string cultureName,
+ bool includeParentCultures = true,
+ bool includeBaseLocalizers = true)
{
//TODO: Can be optimized (example: if it's already default dictionary, skip overriding)
var allStrings = new Dictionary();
- foreach (var baseLocalizer in BaseLocalizers.Select(l => l.WithCulture(CultureInfo.GetCultureInfo(cultureName))))
+ if (includeBaseLocalizers)
{
- //TODO: Try/catch is a workaround here!
- try
+ foreach (var baseLocalizer in BaseLocalizers.Select(l => l.WithCulture(CultureInfo.GetCultureInfo(cultureName))))
{
- var baseLocalizedString = baseLocalizer.GetAllStrings(includeParentCultures);
- foreach (var localizedString in baseLocalizedString)
+ //TODO: Try/catch is a workaround here!
+ try
{
- allStrings[localizedString.Name] = localizedString;
+ var baseLocalizedString = baseLocalizer.GetAllStrings(includeParentCultures);
+ foreach (var localizedString in baseLocalizedString)
+ {
+ allStrings[localizedString.Name] = localizedString;
+ }
}
- }
- catch (MissingManifestResourceException)
- {
+ catch (MissingManifestResourceException)
+ {
+ }
}
}
@@ -160,7 +179,7 @@ namespace Volo.Abp.Localization
: cultureName;
}
- public class CultureWrapperStringLocalizer : IStringLocalizer
+ public class CultureWrapperStringLocalizer : IStringLocalizer, IStringLocalizerSupportsInheritance
{
private readonly string _cultureName;
private readonly AbpDictionaryBasedStringLocalizer _innerLocalizer;
@@ -184,6 +203,11 @@ namespace Volo.Abp.Localization
{
return new CultureWrapperStringLocalizer(culture.Name, _innerLocalizer);
}
+
+ public IEnumerable GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers)
+ {
+ return _innerLocalizer.GetAllStrings(_cultureName, includeParentCultures, includeBaseLocalizers);
+ }
}
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs
index a65e6863a8..23de1929d6 100644
--- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs
+++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs
@@ -23,9 +23,14 @@ namespace Volo.Abp.Localization
Configure(options =>
{
- options.Resources
- .Add("en")
- .AddVirtualJson("/Localization/Resources/AbpValidation");
+ options
+ .Resources
+ .Add("en");
+
+ options
+ .Resources
+ .Add("en")
+ .AddVirtualJson("/Localization/Resources/AbpValidation");
});
}
}
diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerExtensions.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerExtensions.cs
new file mode 100644
index 0000000000..218f9c4164
--- /dev/null
+++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerExtensions.cs
@@ -0,0 +1,58 @@
+using System.Collections.Generic;
+using System.Reflection;
+using JetBrains.Annotations;
+using Microsoft.Extensions.Localization;
+using Volo.Abp.DynamicProxy;
+using Volo.Abp.Reflection;
+
+namespace Volo.Abp.Localization
+{
+ public static class AbpStringLocalizerExtensions
+ {
+ [NotNull]
+ public static IStringLocalizer GetInternalLocalizer(
+ [NotNull] this IStringLocalizer stringLocalizer)
+ {
+ Check.NotNull(stringLocalizer, nameof(stringLocalizer));
+
+ var localizerType = stringLocalizer.GetType();
+ if (!ReflectionHelper.IsAssignableToGenericType(localizerType, typeof(StringLocalizer<>)))
+ {
+ return stringLocalizer;
+ }
+
+ var localizerField = localizerType
+ .GetField(
+ "_localizer",
+ BindingFlags.Instance |
+ BindingFlags.NonPublic
+ );
+
+ if (localizerField == null)
+ {
+ throw new AbpException($"Could not find the _localizer field inside the {typeof(StringLocalizer<>).FullName} class. Probably its name has changed. Please report this issue to the ABP framework.");
+ }
+
+ return localizerField.GetValue(stringLocalizer) as IStringLocalizer;
+ }
+
+ public static IEnumerable GetAllStrings(
+ this IStringLocalizer stringLocalizer,
+ bool includeParentCultures,
+ bool includeBaseLocalizers)
+ {
+ var internalLocalizer = (ProxyHelper.UnProxy(stringLocalizer) as IStringLocalizer).GetInternalLocalizer();
+ if (internalLocalizer is IStringLocalizerSupportsInheritance stringLocalizerSupportsInheritance)
+ {
+ return stringLocalizerSupportsInheritance.GetAllStrings(
+ includeParentCultures,
+ includeBaseLocalizers
+ );
+ }
+
+ return stringLocalizer.GetAllStrings(
+ includeParentCultures
+ );
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/DefaultResource.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/DefaultResource.cs
new file mode 100644
index 0000000000..a491446230
--- /dev/null
+++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/DefaultResource.cs
@@ -0,0 +1,8 @@
+namespace Volo.Abp.Localization
+{
+ [LocalizationResourceName("Default")]
+ public class DefaultResource
+ {
+
+ }
+}
diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IStringLocalizerSupportsInheritance.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IStringLocalizerSupportsInheritance.cs
new file mode 100644
index 0000000000..ccd1616a06
--- /dev/null
+++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IStringLocalizerSupportsInheritance.cs
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+using Microsoft.Extensions.Localization;
+
+namespace Volo.Abp.Localization
+{
+ public interface IStringLocalizerSupportsInheritance
+ {
+ IEnumerable GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers);
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj
index 79955d3241..c218698017 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj
@@ -1,4 +1,4 @@
-
+
@@ -13,6 +13,11 @@
+
+
+
+
+
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs
index c0934e0a4a..8f4be85af2 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs
@@ -1,10 +1,32 @@
-using Volo.Abp.Modularity;
+using Volo.Abp.Localization;
+using Volo.Abp.Modularity;
+using Volo.Abp.Ui.Navigation;
+using Volo.Abp.Ui.Navigation.Localization.Resource;
+using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.UI.Navigation
{
[DependsOn(typeof(AbpUiModule))]
public class AbpUiNavigationModule : AbpModule
{
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ Configure(options =>
+ {
+ options.FileSets.AddEmbedded();
+ });
+ Configure(options =>
+ {
+ options.Resources
+ .Add("en")
+ .AddVirtualJson("/Volo/Abp/Ui/Navigation/Localization/Resource");
+ });
+
+ Configure(options =>
+ {
+ options.MenuContributors.Add(new DefaultMenuContributor());
+ });
+ }
}
}
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenu.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenu.cs
index fce412c22f..a40c67cdf6 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenu.cs
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenu.cs
@@ -1,5 +1,5 @@
-using System.Collections.Generic;
using JetBrains.Annotations;
+using Volo.Abp.Ui.Navigation;
namespace Volo.Abp.UI.Navigation
{
@@ -29,11 +29,11 @@ namespace Volo.Abp.UI.Navigation
///
[NotNull]
- public IList Items { get; } //TODO: Create a specialized collection (that can contain AddAfter for example)
+ public ApplicationMenuItemList Items { get; }
///
/// Can be used to store a custom object related to this menu.
- /// TODO: Conver to dictionary!
+ /// TODO: Convert to dictionary!
///
[CanBeNull]
public object CustomData { get; set; }
@@ -47,7 +47,7 @@ namespace Volo.Abp.UI.Navigation
Name = name;
DisplayName = displayName ?? Name;
- Items = new List();
+ Items = new ApplicationMenuItemList();
}
///
@@ -60,5 +60,10 @@ namespace Volo.Abp.UI.Navigation
Items.Add(menuItem);
return this;
}
+
+ public override string ToString()
+ {
+ return $"[ApplicationMenu] Name = {Name}";
+ }
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuExtensions.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuExtensions.cs
new file mode 100644
index 0000000000..e69471e15d
--- /dev/null
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuExtensions.cs
@@ -0,0 +1,59 @@
+using JetBrains.Annotations;
+using System.Linq;
+using Volo.Abp.Ui.Navigation;
+
+namespace Volo.Abp.UI.Navigation
+{
+ public static class ApplicationMenuExtensions
+ {
+ [NotNull]
+ public static ApplicationMenuItem GetAdministration(
+ [NotNull] this ApplicationMenu applicationMenu)
+ {
+ return applicationMenu.GetMenuItem(
+ DefaultMenuNames.Application.Main.Administration
+ );
+ }
+
+ [NotNull]
+ public static ApplicationMenuItem GetMenuItem(
+ [NotNull] this IHasMenuItems menuWithItems,
+ string menuItemName)
+ {
+ var menuItem = menuWithItems.GetMenuItemOrNull(menuItemName);
+ if (menuItem == null)
+ {
+ throw new AbpException($"Could not find a menu item with given name: {menuItemName}");
+ }
+
+ return menuItem;
+ }
+
+ [CanBeNull]
+ public static ApplicationMenuItem GetMenuItemOrNull(
+ [NotNull] this IHasMenuItems menuWithItems,
+ string menuItemName)
+ {
+ Check.NotNull(menuWithItems, nameof(menuWithItems));
+
+ return menuWithItems.Items.FirstOrDefault(mi => mi.Name == menuItemName);
+ }
+
+ [NotNull]
+ public static IHasMenuItems SetSubItemOrder(
+ [NotNull] this IHasMenuItems menuWithItems,
+ string menuItemName,
+ int order)
+ {
+ Check.NotNull(menuWithItems, nameof(menuWithItems));
+
+ var menuItem = menuWithItems.GetMenuItemOrNull(menuItemName);
+ if (menuItem != null)
+ {
+ menuItem.Order = order;
+ }
+
+ return menuWithItems;
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs
index de19f6db7b..e09c065b00 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using JetBrains.Annotations;
+using Volo.Abp.Ui.Navigation;
namespace Volo.Abp.UI.Navigation
{
@@ -68,7 +69,7 @@ namespace Volo.Abp.UI.Navigation
///
[NotNull]
- public IList Items { get; }
+ public ApplicationMenuItemList Items { get; }
///
/// Can be used to store a custom object related to this menu item. Optional.
@@ -109,7 +110,7 @@ namespace Volo.Abp.UI.Navigation
ElementId = elementId ?? GetDefaultElementId();
CssClass = cssClass;
- Items = new List();
+ Items = new ApplicationMenuItemList();
}
///
@@ -127,5 +128,10 @@ namespace Volo.Abp.UI.Navigation
{
return "MenuItem_" + Name;
}
+
+ public override string ToString()
+ {
+ return $"[ApplicationMenuItem] Name = {Name}";
+ }
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItemList.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItemList.cs
new file mode 100644
index 0000000000..0e9c845664
--- /dev/null
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItemList.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Volo.Abp.UI.Navigation;
+
+namespace Volo.Abp.Ui.Navigation
+{
+ public class ApplicationMenuItemList : List
+ {
+ public ApplicationMenuItemList()
+ {
+
+ }
+
+ public ApplicationMenuItemList(int capacity)
+ : base(capacity)
+ {
+
+ }
+
+ public ApplicationMenuItemList(IEnumerable collection)
+ : base(collection)
+ {
+
+ }
+
+ public void Normalize()
+ {
+ RemoveEmptyItems();
+ Order();
+ }
+
+ private void RemoveEmptyItems()
+ {
+ RemoveAll(item => item.IsLeaf && item.Url.IsNullOrEmpty());
+ }
+
+ private void Order()
+ {
+ //TODO: Is there any way that is more performant?
+ var orderedItems = this.OrderBy(item => item.Order).ToArray();
+ Clear();
+ AddRange(orderedItems);
+ }
+ }
+}
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/DefaultMenuContributor.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/DefaultMenuContributor.cs
new file mode 100644
index 0000000000..c1f035e292
--- /dev/null
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/DefaultMenuContributor.cs
@@ -0,0 +1,34 @@
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Localization;
+using System.Threading.Tasks;
+using Volo.Abp.Ui.Navigation.Localization.Resource;
+using Volo.Abp.UI.Navigation;
+
+namespace Volo.Abp.Ui.Navigation
+{
+ public class DefaultMenuContributor : IMenuContributor
+ {
+ public virtual Task ConfigureMenuAsync(MenuConfigurationContext context)
+ {
+ Configure(context);
+ return Task.CompletedTask;
+ }
+
+ protected virtual void Configure(MenuConfigurationContext context)
+ {
+ var l = context.ServiceProvider
+ .GetRequiredService>();
+
+ if (context.Menu.Name == StandardMenus.Main)
+ {
+ context.Menu.AddItem(
+ new ApplicationMenuItem(
+ DefaultMenuNames.Application.Main.Administration,
+ l["Menu:Administration"],
+ icon: "fa fa-wrench"
+ )
+ );
+ }
+ }
+ }
+}
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/DefaultMenuNames.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/DefaultMenuNames.cs
new file mode 100644
index 0000000000..96032f48fa
--- /dev/null
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/DefaultMenuNames.cs
@@ -0,0 +1,13 @@
+namespace Volo.Abp.Ui.Navigation
+{
+ public static class DefaultMenuNames
+ {
+ public static class Application
+ {
+ public static class Main
+ {
+ public const string Administration = "Abp.Application.Main.Administration";
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/IHasMenuItems.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/IHasMenuItems.cs
index adfa8f2f40..f33ddcd4c2 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/IHasMenuItems.cs
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/IHasMenuItems.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using Volo.Abp.Ui.Navigation;
namespace Volo.Abp.UI.Navigation
{
@@ -7,6 +7,6 @@ namespace Volo.Abp.UI.Navigation
///
/// Menu items.
///
- IList Items { get; }
+ ApplicationMenuItemList Items { get; }
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/AbpUiNavigationResource.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/AbpUiNavigationResource.cs
new file mode 100644
index 0000000000..96d09e9507
--- /dev/null
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/AbpUiNavigationResource.cs
@@ -0,0 +1,10 @@
+using Volo.Abp.Localization;
+
+namespace Volo.Abp.Ui.Navigation.Localization.Resource
+{
+ [LocalizationResourceName("AbpUiNavigation")]
+ public class AbpUiNavigationResource
+ {
+
+ }
+}
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/en.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/en.json
new file mode 100644
index 0000000000..96ca0c5603
--- /dev/null
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/en.json
@@ -0,0 +1,6 @@
+{
+ "culture": "en",
+ "texts": {
+ "Menu:Administration": "Administration"
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/tr.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/tr.json
new file mode 100644
index 0000000000..67c6da0197
--- /dev/null
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/tr.json
@@ -0,0 +1,6 @@
+{
+ "culture": "tr",
+ "texts": {
+ "Menu:Administration": "Yönetim"
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs
index 93b206a2b4..9c96006b02 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
-using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
@@ -9,26 +9,26 @@ namespace Volo.Abp.UI.Navigation
{
public class MenuManager : IMenuManager, ITransientDependency
{
- private readonly NavigationOptions _options;
- private readonly IServiceProvider _serviceProvider;
+ protected NavigationOptions Options { get; }
+ protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
public MenuManager(
IOptions options,
- IServiceProvider serviceProvider)
+ IHybridServiceScopeFactory serviceScopeFactory)
{
- _serviceProvider = serviceProvider;
- _options = options.Value;
+ ServiceScopeFactory = serviceScopeFactory;
+ Options = options.Value;
}
public async Task GetAsync(string name)
{
var menu = new ApplicationMenu(name);
- using (var scope = _serviceProvider.CreateScope())
+ using (var scope = ServiceScopeFactory.CreateScope())
{
var context = new MenuConfigurationContext(menu, scope.ServiceProvider);
- foreach (var contributor in _options.MenuContributors)
+ foreach (var contributor in Options.MenuContributors)
{
await contributor.ConfigureMenuAsync(context);
}
@@ -39,9 +39,14 @@ namespace Volo.Abp.UI.Navigation
return menu;
}
- protected virtual void NormalizeMenu(ApplicationMenu menu)
+ protected virtual void NormalizeMenu(IHasMenuItems menuWithItems)
{
- menu.Items.RemoveAll(item => item.IsLeaf && item.Url.IsNullOrEmpty());
+ foreach (var menuItem in menuWithItems.Items)
+ {
+ NormalizeMenu(menuItem);
+ }
+
+ menuWithItems.Items.Normalize();
}
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/StandardMenus.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/StandardMenus.cs
index b8d63a104d..57a8d7ee41 100644
--- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/StandardMenus.cs
+++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/StandardMenus.cs
@@ -2,6 +2,12 @@ namespace Volo.Abp.UI.Navigation
{
public static class StandardMenus
{
+ /* TODO: Consider to create nested class like
+ * StandardMenus.Application.Main
+ * StandardMenus.Application.User
+ * StandardMenus.Application.Shortcut
+ */
+
public const string Main = "Main";
public const string User = "User";
public const string Shortcut = "Shortcut";
diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/AbpUiResource.cs b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/AbpUiResource.cs
index 9eb90832e5..fb4600be6e 100644
--- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/AbpUiResource.cs
+++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/AbpUiResource.cs
@@ -2,6 +2,7 @@
namespace Localization.Resources.AbpUi
{
+ //TODO: Move to the Volo.Abp.UI.Localization.Resource folder
[LocalizationResourceName("AbpUi")]
public class AbpUiResource
{
diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
index 3a2233c7a6..16af838025 100644
--- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
+++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
@@ -25,14 +25,23 @@
"Delete": "Delete",
"Edit": "Edit",
"ProcessingWithThreeDot": "Processing...",
+ "LoadingWithThreeDot": "Loading...",
+ "Welcome": "Welcome",
"Login": "Login",
"Register": "Register",
"Logout": "Log out",
"Submit": "Submit",
"Back": "Back",
+ "PagerSearch": "Search",
"PagerNext": "Next",
"PagerPrevious": "Previous",
- "PagerInfo": "Showing {0} to {1} of {2} entries.",
+ "PagerFirst": "First",
+ "PagerLast": "Last",
+ "PagerInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
+ "PagerInfoEmpty": "Showing 0 to 0 of 0 entries",
+ "PagerInfoFiltered": "(filtered from _MAX_ total entries)",
+ "NoDataAvailableInDatatable": "No data available in table",
+ "PagerShowMenuEntries": "Show _MENU_ entries",
"DatatableActionDropdownDefaultText": "Actions",
"ChangePassword": "Change password",
"PersonalInfo": "My profile"
diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json
index 6162f7c35f..a3af7c3a22 100644
--- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json
+++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json
@@ -25,14 +25,23 @@
"Delete": "Sil",
"Edit": "Düzenle",
"ProcessingWithThreeDot": "İşleniyor...",
+ "LoadingWithThreeDot": "Yükleniyor...",
+ "Welcome": "Hoşgeldiniz",
"Login": "Giriş",
"Register": "Kaydol",
"Logout": "Çıkış",
"Submit": "Gönder",
"Back": "Geri",
+ "PagerSearch": "Ara",
"PagerNext": "Sonraki",
"PagerPrevious": "Önceki",
- "PagerInfo": "{2} kayıttan {0} ile {1} arası gösteriliyor.",
+ "PagerFirst": "İlk",
+ "PagerLast": "Son",
+ "PagerInfo": "_TOTAL_ kayıttan _START_ ile _END_ arası gösteriliyor.",
+ "PagerInfoEmpty": "0 kayıttan 0 ile 0 arası gösteriliyor.",
+ "PagerInfoFiltered": "(_MAX_ kayıt arasından filtrelendi)",
+ "NoDataAvailableInDatatable": "Tabloda kayır mevcut değil.",
+ "PagerShowMenuEntries": "Sayfada _MENU_ kayıt göster.",
"DatatableActionDropdownDefaultText": "İşlemler",
"ChangePassword": "Şifre değiştir",
"PersonalInfo": "Profilim"
diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json
index e3d8028f0a..c6979529a7 100644
--- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json
+++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json
@@ -25,14 +25,23 @@
"Delete": "删除",
"Edit": "修改",
"ProcessingWithThreeDot": "处理中...",
+ "LoadingWithThreeDot": "加载中...",
+ "Welcome": "欢迎",
"Login": "登录",
"Register": "注册",
"Logout": "注销",
"Submit": "提交",
"Back": "返回",
+ "PagerSearch": "搜索",
"PagerNext": "下一页",
"PagerPrevious": "上一页",
+ "PagerFirst": "首页",
+ "PagerLast": "尾页",
"PagerInfo": "显示 {0} 到 {1} 个 {2} 条目.",
+ "PagerInfoEmpty": "显示0个条目中的0到0",
+ "PagerInfoFiltered": "(从 _MAX_ 总条目中过滤掉)",
+ "NoDataAvailableInDatatable": "表中没有数据",
+ "PagerShowMenuEntries": "显示 _MENU_ 实体",
"DatatableActionDropdownDefaultText": "操作",
"ChangePassword": "修改密码",
"PersonalInfo": "个人信息"
diff --git a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj
index 1a7ab915c9..8716d7a210 100644
--- a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj
+++ b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj
@@ -1,4 +1,4 @@
-
+
@@ -15,6 +15,7 @@
+
diff --git a/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs
index fb173ee882..0a9206c309 100644
--- a/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs
+++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs
@@ -20,7 +20,9 @@ namespace Volo.Abp.UI
Configure(options =>
{
- options.Resources.Add("en").AddVirtualJson("/Localization/Resources/AbpUi");
+ options.Resources
+ .Add("en")
+ .AddVirtualJson("/Localization/Resources/AbpUi");
});
}
}
diff --git a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/TestFeatureStore.cs b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/TestFeatureStore.cs
index 87fef33a8d..4592a18365 100644
--- a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/TestFeatureStore.cs
+++ b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/TestFeatureStore.cs
@@ -20,9 +20,9 @@ namespace Volo.Abp.Features
{
_settingRecords = new List
{
- new SettingRecord("BooleanTestFeature1", TenantFeatureValueProvider.ProviderName, Tenant1Id.ToString(), "true"),
- new SettingRecord("BooleanTestFeature2", TenantFeatureValueProvider.ProviderName, Tenant1Id.ToString(), "true"),
- new SettingRecord("IntegerTestFeature1", TenantFeatureValueProvider.ProviderName, Tenant2Id.ToString(), "34")
+ new SettingRecord("BooleanTestFeature1", TenantFeatureValueProvider.ProviderName, Tenant1Id.ToString("N"), "true"),
+ new SettingRecord("BooleanTestFeature2", TenantFeatureValueProvider.ProviderName, Tenant1Id.ToString("N"), "true"),
+ new SettingRecord("IntegerTestFeature1", TenantFeatureValueProvider.ProviderName, Tenant2Id.ToString("N"), "34")
};
}
diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs
index ea6ce3e242..309e317997 100644
--- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs
+++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs
@@ -1,4 +1,5 @@
using System.Globalization;
+using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Shouldly;
@@ -14,10 +15,28 @@ namespace Volo.Abp.Localization
public class AbpLocalization_Tests : AbpIntegratedTest
{
private readonly IStringLocalizer _localizer;
+ private readonly IStringLocalizerFactory _localizerFactory;
public AbpLocalization_Tests()
{
_localizer = GetRequiredService>();
+ _localizerFactory = GetRequiredService();
+ }
+
+ [Fact]
+ public void AbpStringLocalizerExtensions_GetInternalLocalizer()
+ {
+ var internalLocalizer = _localizer.GetInternalLocalizer();
+ internalLocalizer.ShouldNotBeNull();
+ internalLocalizer.ShouldBeOfType();
+ }
+
+ [Fact]
+ public void AbpStringLocalizerExtensions_GetInternalLocalizer_Using_LocalizerFactory()
+ {
+ var internalLocalizer = _localizerFactory.Create(typeof(LocalizationTestResource)).GetInternalLocalizer();
+ internalLocalizer.ShouldNotBeNull();
+ internalLocalizer.ShouldBeOfType();
}
[Fact]
@@ -104,6 +123,102 @@ namespace Volo.Abp.Localization
_localizer.WithCulture(CultureInfo.GetCultureInfo("tr"))["CarPlural"].Value.ShouldBe("Araba");
}
+ [Fact]
+ public void GetAllStrings_With_Parents()
+ {
+ using (AbpCultureHelper.Use("tr"))
+ {
+ var localizedStrings = _localizer.GetAllStrings(true).ToList();
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "FortyTwo" &&
+ ls.Value == "Forty Two" &&
+ ls.ResourceNotFound == false
+ );
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "Universe" &&
+ ls.Value == "Evren" &&
+ ls.ResourceNotFound == false
+ );
+ }
+ }
+
+ [Fact]
+ public void GetAllStrings_Without_Parents()
+ {
+ using (AbpCultureHelper.Use("tr"))
+ {
+ var localizedStrings = _localizer.GetAllStrings(false).ToList();
+
+ localizedStrings.ShouldNotContain(
+ ls => ls.Name == "FortyTwo"
+ );
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "Universe" &&
+ ls.Value == "Evren" &&
+ ls.ResourceNotFound == false
+ );
+ }
+ }
+
+ [Fact]
+ public void GetAllStrings_With_Inheritance()
+ {
+ using (AbpCultureHelper.Use("tr"))
+ {
+ var localizedStrings = _localizer
+ .GetAllStrings(true, includeBaseLocalizers: true)
+ .ToList();
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "USA" &&
+ ls.Value == "Amerika Birleşik Devletleri" &&
+ ls.ResourceNotFound == false
+ );
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "Universe" &&
+ ls.Value == "Evren" &&
+ ls.ResourceNotFound == false
+ );
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "SeeYou" &&
+ ls.Value == "See you" &&
+ ls.ResourceNotFound == false
+ );
+ }
+ }
+
+ [Fact]
+ public void GetAllStrings_Without_Inheritance()
+ {
+ using (AbpCultureHelper.Use("tr"))
+ {
+ var localizedStrings = _localizer
+ .GetAllStrings(true, includeBaseLocalizers: false)
+ .ToList();
+
+ localizedStrings.ShouldNotContain(
+ ls => ls.Name == "USA"
+ );
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "Universe" &&
+ ls.Value == "Evren" &&
+ ls.ResourceNotFound == false
+ );
+
+ localizedStrings.ShouldContain(
+ ls => ls.Name == "SeeYou" &&
+ ls.Value == "See you" &&
+ ls.ResourceNotFound == false
+ );
+ }
+ }
+
[DependsOn(typeof(AbpTestBaseModule))]
[DependsOn(typeof(AbpLocalizationModule))]
public class TestModule : AbpModule
@@ -117,10 +232,21 @@ namespace Volo.Abp.Localization
Configure(options =>
{
- options.Resources.Add("en").AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/Validation");
- options.Resources.Add("en").AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/CountryNames");
- options.Resources.Add("en").AddVirtualJson("/Volo/Abp/Localization/TestResources/Source");
- options.Resources.Get().AddVirtualJson("/Volo/Abp/Localization/TestResources/SourceExt");
+ options.Resources
+ .Add("en")
+ .AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/Validation");
+
+ options.Resources
+ .Add("en")
+ .AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/CountryNames");
+
+ options.Resources
+ .Add("en")
+ .AddVirtualJson("/Volo/Abp/Localization/TestResources/Source");
+
+ options.Resources
+ .Get()
+ .AddVirtualJson("/Volo/Abp/Localization/TestResources/SourceExt");
});
}
}
diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs
index 04cacc6b20..9344085adf 100644
--- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs
+++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs
@@ -3,8 +3,10 @@ using Volo.Abp.Localization.TestResources.Base.Validation;
namespace Volo.Abp.Localization.TestResources.Source
{
- [InheritResource(typeof(LocalizationTestValidationResource))]
- [InheritResource(typeof(LocalizationTestCountryNamesResource))]
+ [InheritResource(
+ typeof(LocalizationTestValidationResource),
+ typeof(LocalizationTestCountryNamesResource)
+ )]
public sealed class LocalizationTestResource
{
diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
index 0388b6efe2..098b3655ee 100644
--- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
+++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
@@ -5,6 +5,7 @@
"Car": "Car",
"CarPlural": "Cars",
"MaxLenghtErrorMessage": "This field's length can be maximum of '{0}' chars",
- "Universe": "Universe"
+ "Universe": "Universe",
+ "FortyTwo": "Forty Two"
}
}
\ No newline at end of file
diff --git a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs
index c7f2093e83..77203962ae 100644
--- a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs
+++ b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs
@@ -2,7 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using Shouldly;
using Volo.Abp.Modularity;
-using System.Collections.Generic;
+using Volo.Abp.Ui.Navigation;
using Xunit;
namespace Volo.Abp.UI.Navigation
@@ -25,10 +25,13 @@ namespace Volo.Abp.UI.Navigation
mainMenu.DisplayName.ShouldBe("Main Menu");
mainMenu.Items.Count.ShouldBe(2);
mainMenu.Items[0].Name.ShouldBe("Dashboard");
- mainMenu.Items[1].Name.ShouldBe("Administration");
+ mainMenu.Items[1].Name.ShouldBe(DefaultMenuNames.Application.Main.Administration);
mainMenu.Items[1].Items[0].Name.ShouldBe("Administration.UserManagement");
mainMenu.Items[1].Items[1].Name.ShouldBe("Administration.RoleManagement");
mainMenu.Items[1].Items[2].Name.ShouldBe("Administration.DashboardSettings");
+ mainMenu.Items[1].Items[3].Name.ShouldBe("Administration.SubMenu1");
+ mainMenu.Items[1].Items[3].Items[0].Name.ShouldBe("Administration.SubMenu1.1");
+ mainMenu.Items[1].Items[3].Items[1].Name.ShouldBe("Administration.SubMenu1.2");
}
[DependsOn(typeof(AbpUiNavigationModule))]
@@ -60,10 +63,7 @@ namespace Volo.Abp.UI.Navigation
context.Menu.DisplayName = "Main Menu";
- var administration = context.Menu.Items.GetOrAdd(
- m => m.Name == "Administration",
- () => new ApplicationMenuItem("Administration", "Administration")
- );
+ var administration = context.Menu.GetAdministration();
administration.AddItem(new ApplicationMenuItem("Administration.UserManagement", "User Management", url: "/admin/users"));
administration.AddItem(new ApplicationMenuItem("Administration.RoleManagement", "Role Management", url: "/admin/roles"));
@@ -88,13 +88,16 @@ namespace Volo.Abp.UI.Navigation
context.Menu.Items.Insert(0, new ApplicationMenuItem("Dashboard", "Dashboard", url: "/dashboard"));
- var administration = context.Menu.Items.GetOrAdd(
- m => m.Name == "Administration",
- () => new ApplicationMenuItem("Administration", "Administration")
- );
+ var administration = context.Menu.GetAdministration();
administration.AddItem(new ApplicationMenuItem("Administration.DashboardSettings", "Dashboard Settings", url: "/admin/settings/dashboard"));
+ administration.AddItem(
+ new ApplicationMenuItem("Administration.SubMenu1", "Sub menu 1")
+ .AddItem(new ApplicationMenuItem("Administration.SubMenu1.1", "Sub menu 1.1", url: "/submenu1/submenu1_1"))
+ .AddItem(new ApplicationMenuItem("Administration.SubMenu1.2", "Sub menu 1.2", url: "/submenu1/submenu1_2"))
+ );
+
return Task.CompletedTask;
}
}
diff --git a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs
index 3992e15f49..700d52b3a9 100644
--- a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs
+++ b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs
@@ -47,6 +47,12 @@ namespace Volo.Abp.Account.Web.Areas.Account.Controllers
{
ValidateLoginInfo(login);
var identityUser = await _userManager.FindByNameAsync(login.UserNameOrEmailAddress);
+
+ if (identityUser == null)
+ {
+ return new AbpLoginResult(LoginResultType.InvalidUserNameOrPassword);
+ }
+
return GetAbpLoginResult(await _signInManager.CheckPasswordSignInAsync(identityUser, login.Password, true));
}
diff --git a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json
index fdaa5ff228..9ceb4af554 100644
--- a/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json
+++ b/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json
@@ -11,12 +11,12 @@
"InvalidUserNameOrPassword": "用户名或密码错误!",
"LoginIsNotAllowed": "无法登录!你需要验证邮箱地址/手机号.",
"SelfRegistrationDisabledMessage": "应用程序未开放注册,请联系管理员添加新用户.",
- "Login": "Login",
- "Cancel": "Cancel",
- "Register": "Register",
- "UseAnotherServiceToLogIn.": "Use another service to log in.",
- "InvalidLoginRequest": "Invalid login request",
- "ThereAreNoLoginSchemesConfiguredForThisClient": "There are no login schemes configured for this client.",
- "LogInUsingYourProviderAccount": "Log in using your {0} account"
+ "Login": "登录",
+ "Cancel": "取消",
+ "Register": "注册",
+ "UseAnotherServiceToLogIn.": "使用其他服务登录.",
+ "InvalidLoginRequest": "登录请求无效",
+ "ThereAreNoLoginSchemesConfiguredForThisClient": "没有为此客户端配置登录方案.",
+ "LogInUsingYourProviderAccount": "使用您的{0}帐户登录"
}
}
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs
index 513861bf11..489a07a0ce 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs
@@ -20,6 +20,7 @@ namespace Volo.Abp.AuditLogging
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
bool includeDetails = false,
CancellationToken cancellationToken = default);
@@ -32,6 +33,7 @@ namespace Volo.Abp.AuditLogging
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
CancellationToken cancellationToken = default);
}
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
index e1f720e8cd..043c3d8988 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
@@ -30,11 +30,12 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
- var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxExecutionDuration, minExecutionDuration, httpStatusCode, includeDetails);
+ var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxExecutionDuration, minExecutionDuration, hasException, httpStatusCode, includeDetails);
var auditLogs = await query.OrderBy(sorting ?? "executionTime desc")
.PageBy(skipCount, maxResultCount)
@@ -51,10 +52,11 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
CancellationToken cancellationToken = default)
{
- var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxExecutionDuration, minExecutionDuration, httpStatusCode);
+ var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxExecutionDuration, minExecutionDuration, hasException, httpStatusCode);
var totalCount = await query.LongCountAsync();
@@ -69,11 +71,14 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
bool includeDetails = false)
{
return DbSet.AsNoTracking()
.IncludeDetails(includeDetails)
+ .WhereIf(hasException.HasValue && hasException.Value, auditLog => auditLog.Exceptions != null && auditLog.Exceptions.Length > 0)
+ .WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions.Length == 0)
.WhereIf(httpMethod != null, auditLog => auditLog.HttpMethod != null && auditLog.HttpMethod.ToLowerInvariant() == httpMethod.ToLowerInvariant())
.WhereIf(url != null, auditLog => auditLog.Url != null && auditLog.Url.ToLowerInvariant().Contains(url.ToLowerInvariant()))
.WhereIf(userName != null, auditLog => auditLog.UserName != null && auditLog.UserName.ToLowerInvariant() == userName.ToLowerInvariant())
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs
index 09988682af..f70bd1deaf 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs
@@ -31,11 +31,12 @@ namespace Volo.Abp.AuditLogging.MongoDB
string correlationId = null,
int? maxDuration = null,
int? minDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
- var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxDuration, minDuration, httpStatusCode, includeDetails);
+ var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxDuration, minDuration, hasException, httpStatusCode, includeDetails);
return await query.OrderBy(sorting ?? "executionTime desc").As>()
.PageBy>(skipCount, maxResultCount)
@@ -50,10 +51,11 @@ namespace Volo.Abp.AuditLogging.MongoDB
string correlationId = null,
int? maxDuration = null,
int? minDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
CancellationToken cancellationToken = default)
{
- var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxDuration, minDuration, httpStatusCode);
+ var query = GetListQuery(httpMethod, url, userName, applicationName, correlationId, maxDuration, minDuration, hasException, httpStatusCode);
var count = await query.As>().LongCountAsync();
@@ -68,10 +70,13 @@ namespace Volo.Abp.AuditLogging.MongoDB
string correlationId = null,
int? maxDuration = null,
int? minDuration = null,
+ bool? hasException = null,
HttpStatusCode? httpStatusCode = null,
bool includeDetails = false)
{
return GetMongoQueryable()
+ .WhereIf(hasException.HasValue && hasException.Value, auditLog => auditLog.Exceptions != null && auditLog.Exceptions.Length > 0)
+ .WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions.Length == 0)
.WhereIf(httpMethod != null, auditLog => auditLog.HttpMethod != null && auditLog.HttpMethod.ToLowerInvariant() == httpMethod.ToLowerInvariant())
.WhereIf(url != null, auditLog => auditLog.Url != null && auditLog.Url.ToLowerInvariant().Contains(url.ToLowerInvariant()))
.WhereIf(userName != null, auditLog => auditLog.UserName != null && auditLog.UserName.ToLowerInvariant() == userName.ToLowerInvariant())
@@ -79,7 +84,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
.WhereIf(correlationId != null, auditLog => auditLog.CorrelationId != null && auditLog.CorrelationId.ToLowerInvariant() == correlationId.ToLowerInvariant())
.WhereIf(httpStatusCode != null && httpStatusCode > 0, auditLog => auditLog.HttpStatusCode == (int?)httpStatusCode)
.WhereIf(maxDuration != null && maxDuration > 0, auditLog => auditLog.ExecutionDuration <= maxDuration)
- .WhereIf(minDuration != null && minDuration > 0, auditLog => auditLog.ExecutionDuration >= minDuration); ;
+ .WhereIf(minDuration != null && minDuration > 0, auditLog => auditLog.ExecutionDuration >= minDuration);
}
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs
index 34488f77a1..916455bc47 100644
--- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs
+++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs
@@ -228,8 +228,9 @@ namespace Volo.Blogging.Posts
{
tag.IncreaseUsageCount();
tag = await _tagRepository.UpdateAsync(tag);
- post.AddTag(tag.Id);
}
+
+ post.AddTag(tag.Id);
}
}
diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
index 7b7728c0f7..397739263a 100644
--- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
+++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
@@ -27,7 +27,7 @@ namespace Volo.Blogging.EntityFrameworkCore
{
b.ToTable(options.TablePrefix + "Users", options.Schema);
- b.ConfigureAbpUser(options);
+ b.ConfigureAbpUser();
b.ConfigureExtraProperties();
});
diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json
new file mode 100644
index 0000000000..3c8847ceae
--- /dev/null
+++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json
@@ -0,0 +1,10 @@
+{
+ "culture": "zh-Hans",
+ "texts": {
+ "Permission:DocumentManagement": "文档管理",
+ "Permission:Projects": "项目",
+ "Permission:Edit": "编辑",
+ "Permission:Delete": "删除",
+ "Permission:Create": "创建"
+ }
+ }
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/zh-Hans.json b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/zh-Hans.json
new file mode 100644
index 0000000000..36bc285090
--- /dev/null
+++ b/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/zh-Hans.json
@@ -0,0 +1,26 @@
+{
+ "culture": "zh-Hans",
+ "texts": {
+ "Menu:DocumentManagement": "文档",
+ "Menu:ProjectManagement": "项目",
+ "CreateANewProject": "创建新项目",
+ "Edit": "编辑",
+ "Create": "创建",
+ "Projects": "项目",
+ "Name": "名称",
+ "ShortName": "简称",
+ "DocumentStoreType": "文件存储类型",
+ "Format": "格式",
+ "ShortNameInfoText": "将用于唯一的URL.",
+ "DisplayName:Name": "名称",
+ "DisplayName:ShortName": "简称",
+ "DisplayName:Format": "格式",
+ "DisplayName:DefaultDocumentName": "默认文档名称",
+ "DisplayName:NavigationDocumentName": "导航文档名称",
+ "DisplayName:MinimumVersion": "最低版本",
+ "DisplayName:MainWebsiteUrl": "主网站网址",
+ "DisplayName:LatestVersionBranchName": "最新版本的分支名称",
+ "DisplayName:GitHubRootUrl": "GitHub根网址",
+ "DisplayName:GitHubAccessToken": "GitHub访问令牌"
+ }
+ }
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/zh-Hans.json b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/zh-Hans.json
index 03a22148c2..f085265abf 100644
--- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/zh-Hans.json
+++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/zh-Hans.json
@@ -2,14 +2,17 @@
"culture": "zh-Hans",
"texts": {
"Documents": "文档",
- "BackToWebsite": "返回网站",
+ "BackToWebsite": "返回主网站",
+ "Contributors": "贡献者",
+ "ShareOn": "分享到",
"Version": "版本",
"Edit": "编辑",
- "InThisDocument": "在这个文档中",
- "GoToTop": "返回顶部",
+ "Delete": "删除",
+ "InThisDocument": "在本文中",
+ "GoToTop": "到顶部",
"Projects": "项目",
- "NoProjectWarning": "当前并没有项目!",
- "DocumentNotFound": "抱歉,您请求的文档不存在!",
- "NavigationDocumentNotFound": "此版本并没有导航文档!"
+ "NoProjectWarning": "还没有项目!",
+ "DocumentNotFound": "找不到请求的文档!",
+ "NavigationDocumentNotFound": "这个版本没有导航文件!"
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs
index c3d142aefc..821457ac93 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs
@@ -7,6 +7,7 @@ using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Users;
using Volo.Abp.VirtualFileSystem;
+using Volo.Abp.Localization.ExceptionHandling;
namespace Volo.Abp.Identity
{
@@ -32,6 +33,11 @@ namespace Volo.Abp.Identity
.Get()
.AddVirtualJson("/Volo/Abp/Identity/Localization/ApplicationContracts");
});
+
+ Configure(options =>
+ {
+ options.MapCodeNamespace("Volo.Abp.Identity", typeof(IdentityResource));
+ });
}
}
}
\ No newline at end of file
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs
index 8927121bf9..f3e342503c 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs
@@ -14,7 +14,5 @@ namespace Volo.Abp.Identity
Task FindByUsernameAsync(string username);
Task FindByEmailAsync(string email);
-
- Task ChangePasswordAsync(string currentPassword, string newPassword);
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs
index cb61fc6a82..142b5ad16a 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs
@@ -8,5 +8,7 @@ namespace Volo.Abp.Identity
Task GetAsync();
Task UpdateAsync(UpdateProfileDto input);
+
+ Task ChangePasswordAsync(string currentPassword, string newPassword);
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityErrorCodes.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityErrorCodes.cs
new file mode 100644
index 0000000000..4bdfc5d8e9
--- /dev/null
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityErrorCodes.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Volo.Abp.Identity
+{
+ public static class IdentityErrorCodes
+ {
+ public const string UserSelfDeletion = "Volo.Abp.Identity:010001";
+ }
+}
\ No newline at end of file
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/en.json b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/en.json
index 4a302c8057..22464dae71 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/en.json
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/en.json
@@ -1,6 +1,7 @@
{
"culture": "en",
"texts": {
+ "Volo.Abp.Identity:010001": "You can not delete your own account!",
"Permission:IdentityManagement": "Identity management",
"Permission:RoleManagement": "Role management",
"Permission:Create": "Create",
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/tr.json b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/tr.json
index 25760c354b..4e0746de1f 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/tr.json
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/tr.json
@@ -1,6 +1,7 @@
{
"culture": "tr",
"texts": {
+ "Volo.Abp.Identity:010001": "Kendi hesabınızı silemezsiniz!",
"Permission:IdentityManagement": "Kimlik yönetimi",
"Permission:RoleManagement": "Rol yönetimi",
"Permission:Create": "Oluşturma",
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/zh-Hans.json b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/zh-Hans.json
index 616e9a62a3..cae53933d9 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/zh-Hans.json
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/zh-Hans.json
@@ -1,12 +1,14 @@
{
"culture": "zh-Hans",
"texts": {
- "Permission:IdentityManagement": "身份认证管理",
+ "Volo.Abp.Identity:010001": "您无法删除自己的帐户!",
+ "Permission:IdentityManagement": "身份标识管理",
"Permission:RoleManagement": "角色管理",
"Permission:Create": "创建",
"Permission:Edit": "编辑",
"Permission:Delete": "删除",
"Permission:ChangePermissions": "更改权限",
- "Permission:UserManagement": "用户管理"
+ "Permission:UserManagement": "用户管理",
+ "Permission:UserLookup": "用户查询"
}
}
\ No newline at end of file
diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs
index e1fb6ba8e5..ad87b0041f 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs
@@ -80,6 +80,11 @@ namespace Volo.Abp.Identity
[Authorize(IdentityPermissions.Users.Delete)]
public async Task DeleteAsync(Guid id)
{
+ if (CurrentUser.Id == id)
+ {
+ throw new BusinessException(code: IdentityErrorCodes.UserSelfDeletion);
+ }
+
var user = await _userManager.FindByIdAsync(id.ToString());
if (user == null)
{
@@ -113,18 +118,6 @@ namespace Volo.Abp.Identity
);
}
- //TODO: Move this to the profile service!
- public async Task ChangePasswordAsync(string currentPassword, string newPassword)
- {
- if (!CurrentUser.Id.HasValue)
- {
- throw new AbpException("Current user Id is null!");
- }
-
- var currentUser = await _userManager.GetByIdAsync(CurrentUser.Id.Value);
- (await _userManager.ChangePasswordAsync(currentUser, currentPassword, newPassword)).CheckErrors();
- }
-
private async Task UpdateUserByInput(IdentityUser user, IdentityUserCreateOrUpdateDtoBase input)
{
(await _userManager.SetEmailAsync(user, input.Email)).CheckErrors();
diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs
index a47734cd0c..64a78b81ca 100644
--- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs
@@ -49,5 +49,11 @@ namespace Volo.Abp.Identity
return ObjectMapper.Map(user);
}
+
+ public async Task ChangePasswordAsync(string currentPassword, string newPassword)
+ {
+ var currentUser = await _userManager.GetByIdAsync(CurrentUser.GetId());
+ (await _userManager.ChangePasswordAsync(currentUser, currentPassword, newPassword)).CheckErrors();
+ }
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj b/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj
index 2d7948e20d..b0cff474c1 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj
+++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj
@@ -17,6 +17,12 @@
+
+
+
+
+
+
@@ -29,8 +35,4 @@
-
-
-
-
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeeder.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeeder.cs
index 0ff080cfad..09718049de 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeeder.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeeder.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.DependencyInjection;
@@ -53,7 +52,7 @@ namespace Volo.Abp.Identity
adminUser = new IdentityUser(_guidGenerator.Create(), adminUserName, "admin@abp.io", tenantId);
adminUser.Name = adminUserName;
- CheckIdentityErrors(await _userManager.CreateAsync(adminUser, adminUserPassword));
+ (await _userManager.CreateAsync(adminUser, adminUserPassword)).CheckErrors();
result.CreatedAdminUser = true;
//"admin" role
@@ -65,24 +64,13 @@ namespace Volo.Abp.Identity
adminRole.IsStatic = true;
adminRole.IsPublic = true;
- CheckIdentityErrors(await _roleManager.CreateAsync(adminRole));
+ (await _roleManager.CreateAsync(adminRole)).CheckErrors();
result.CreatedAdminRole = true;
}
- CheckIdentityErrors(await _userManager.AddToRoleAsync(adminUser, adminRoleName));
+ (await _userManager.AddToRoleAsync(adminUser, adminRoleName)).CheckErrors();
return result;
}
-
- protected void CheckIdentityErrors(IdentityResult identityResult) //TODO: This is temporary and duplicate code!
- {
- if (!identityResult.Succeeded)
- {
- //TODO: A better exception that can be shown on UI as localized?
- throw new AbpException("Operation failed: " + identityResult.Errors.Select(e => $"[{e.Code}] {e.Description}").JoinAsString(", "));
- }
-
- //identityResult.CheckErrors(LocalizationManager); //TODO: Get from old Abp
- }
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs
index ce8e1e47d5..0e3fb21688 100644
--- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs
+++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs
@@ -25,7 +25,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
b.ConfigureFullAudited();
b.ConfigureExtraProperties();
b.ConfigureConcurrencyStamp();
- b.ConfigureAbpUser(options);
+ b.ConfigureAbpUser();
b.Property(u => u.NormalizedUserName).IsRequired().HasMaxLength(IdentityUserConsts.MaxNormalizedUserNameLength).HasColumnName(nameof(IdentityUser.NormalizedUserName));
b.Property(u => u.NormalizedEmail).HasMaxLength(IdentityUserConsts.MaxNormalizedEmailLength).HasColumnName(nameof(IdentityUser.NormalizedEmail));
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs
index 2728e16fbd..acbc211b0f 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs
@@ -64,10 +64,5 @@ namespace Volo.Abp.Identity
{
return _userAppService.FindByEmailAsync(email);
}
-
- public Task ChangePasswordAsync(string currentPassword, string newPassword)
- {
- return _userAppService.ChangePasswordAsync(currentPassword, newPassword);
- }
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs
index b1bb8a744c..4547bbdc1c 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
@@ -27,5 +24,10 @@ namespace Volo.Abp.Identity
{
return _profileAppService.UpdateAsync(input);
}
+
+ public Task ChangePasswordAsync(string currentPassword, string newPassword)
+ {
+ return _profileAppService.ChangePasswordAsync(currentPassword, newPassword);
+ }
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs b/modules/identity/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs
index 22581401be..f607e62bd3 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs
@@ -16,11 +16,13 @@ namespace Volo.Abp.Identity.Web.Navigation
return;
}
+ var administrationMenu = context.Menu.GetAdministration();
+
var authorizationService = context.ServiceProvider.GetRequiredService();
var l = context.ServiceProvider.GetRequiredService>();
var identityMenuItem = new ApplicationMenuItem(IdentityMenuNames.GroupName, l["Menu:IdentityManagement"], icon: "fa fa-id-card-o");
- context.Menu.AddItem(identityMenuItem);
+ administrationMenu.AddItem(identityMenuItem);
if (await authorizationService.IsGrantedAsync(IdentityPermissions.Roles.Default))
{
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Shared/ChangePasswordModal.cshtml.cs b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Shared/ChangePasswordModal.cshtml.cs
index 0e753edd6c..29dda11426 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Shared/ChangePasswordModal.cshtml.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Shared/ChangePasswordModal.cshtml.cs
@@ -12,13 +12,14 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Shared
[BindProperty]
public ChangePasswordInfoModel ChangePasswordInfoModel { get; set; }
- private readonly IIdentityUserAppService _userAppService;
+ private readonly IProfileAppService _profileAppService;
private readonly IStringLocalizer _localizer;
- public ChangePasswordModal(IIdentityUserAppService userAppService,
+ public ChangePasswordModal(
+ IProfileAppService profileAppService,
IStringLocalizer localizer)
{
- _userAppService = userAppService;
+ _profileAppService = profileAppService;
_localizer = localizer;
}
@@ -31,8 +32,10 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Shared
throw new UserFriendlyException(_localizer.GetString("Identity.PasswordConfirmationFailed").Value);
}
- await _userAppService.ChangePasswordAsync(ChangePasswordInfoModel.CurrentPassword,
- ChangePasswordInfoModel.NewPassword);
+ await _profileAppService.ChangePasswordAsync(
+ ChangePasswordInfoModel.CurrentPassword,
+ ChangePasswordInfoModel.NewPassword
+ );
return NoContent();
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
index ed45747c0c..d20d0a0026 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
@@ -31,7 +31,6 @@
}
-
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
index be9cc9b205..247e59e46b 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
@@ -32,7 +32,6 @@
}
-
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/zh-Hans.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/zh-Hans.json
index 991c147b58..8384078b86 100644
--- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/zh-Hans.json
+++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/zh-Hans.json
@@ -1,6 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
- "Permissions": "权限"
+ "Permissions": "权限",
+ "OnlyProviderPermissons": "只有这个提供商",
+ "All": "所有"
}
}
\ No newline at end of file
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml
index beb39387b8..d1081f2f84 100644
--- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml
+++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml
@@ -14,23 +14,24 @@
-
+
@for (var i = 0; i < Model.Groups.Count; i++)
{
@Model.Groups[i].DisplayName
-
- @for (var j = 0; j < Model.Groups[i].Permissions.Count; j++)
- {
-
-
- }
+
+ @for (var j = 0; j < Model.Groups[i].Permissions.Count; j++)
+ {
+
+
+ }
+
}
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs
index b10d3c69c3..f1fae6b2f3 100644
--- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs
@@ -1,5 +1,7 @@
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
+using Volo.Abp.Localization;
using Volo.Abp.Modularity;
+using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.SettingManagement.Web.Navigation;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
@@ -22,6 +24,19 @@ namespace Volo.Abp.SettingManagement.Web
{
options.FileSets.AddEmbedded("Volo.Abp.SettingManagement.Web");
});
+
+ Configure(options =>
+ {
+ options.Resources
+ .Add("en");
+ });
+
+ Configure(options =>
+ {
+ options.Resources
+ .Get()
+ .AddVirtualJson("/Localization/Resources/AbpSettingManagement");
+ });
}
}
}
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/AbpSettingManagementResource.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/AbpSettingManagementResource.cs
new file mode 100644
index 0000000000..a89f749e4c
--- /dev/null
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/AbpSettingManagementResource.cs
@@ -0,0 +1,10 @@
+using Volo.Abp.Localization;
+
+namespace Volo.Abp.SettingManagement.Localization
+{
+ [LocalizationResourceName("AbpSettingManagement")]
+ public class AbpSettingManagementResource
+ {
+
+ }
+}
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/en.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/en.json
new file mode 100644
index 0000000000..654885f10b
--- /dev/null
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/en.json
@@ -0,0 +1,6 @@
+{
+ "culture": "en",
+ "texts": {
+ "Settings": "Settings"
+ }
+}
\ No newline at end of file
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/tr.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/tr.json
new file mode 100644
index 0000000000..0e80027b84
--- /dev/null
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/tr.json
@@ -0,0 +1,6 @@
+{
+ "culture": "tr",
+ "texts": {
+ "Settings": "Ayarlar"
+ }
+}
\ No newline at end of file
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/zh-Hans.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/zh-Hans.json
new file mode 100644
index 0000000000..060fa17388
--- /dev/null
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/zh-Hans.json
@@ -0,0 +1,6 @@
+{
+ "culture": "zh-Hans",
+ "texts": {
+ "Settings": "设置"
+ }
+ }
\ No newline at end of file
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs
index c6ff751d57..79ed300398 100644
--- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs
@@ -1,7 +1,9 @@
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using System.Linq;
using System.Threading.Tasks;
+using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.SettingManagement.Web.Pages.SettingManagement;
using Volo.Abp.UI.Navigation;
@@ -22,10 +24,18 @@ namespace Volo.Abp.SettingManagement.Web.Navigation
return Task.CompletedTask;
}
- //TODO: Localize
- //var l = context.ServiceProvider.GetRequiredService>();
+ var l = context.ServiceProvider.GetRequiredService>();
- context.Menu.AddItem(new ApplicationMenuItem(SettingManagementMenuNames.GroupName, "Settings", "/SettingManagement", icon: "fa fa-cog", order: int.MaxValue - 1000));
+ context.Menu
+ .GetAdministration()
+ .AddItem(
+ new ApplicationMenuItem(
+ SettingManagementMenuNames.GroupName,
+ l["Settings"],
+ "/SettingManagement",
+ icon: "fa fa-cog"
+ )
+ );
return Task.CompletedTask;
}
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMenuNames.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMenuNames.cs
index 67678f5b9e..4c5af73abe 100644
--- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMenuNames.cs
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMenuNames.cs
@@ -1,14 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Volo.Abp.SettingManagement.Web.Navigation
+namespace Volo.Abp.SettingManagement.Web.Navigation
{
public class SettingManagementMenuNames
{
public const string GroupName = "SettingManagement";
-
- public const string Settings = GroupName + ".Settings";
}
}
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml
index c14c416a36..edcc541bfe 100644
--- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml
@@ -1,11 +1,14 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
+@using Microsoft.AspNetCore.Mvc.Localization
+@using Volo.Abp.SettingManagement.Localization
@using Volo.Abp.SettingManagement.Web.Navigation
@using Volo.Abp.SettingManagement.Web.Pages.SettingManagement
@model IndexModel
+@inject IHtmlLocalizer L
@inject IPageLayout PageLayout
@{
- PageLayout.Content.Title = /*L["Settings"].Value*/ "Settings";
+ PageLayout.Content.Title = L["Settings"].Value;
PageLayout.Content.MenuItemName = SettingManagementMenuNames.GroupName;
}
@section scripts {
@@ -14,21 +17,21 @@
}
-
-
-
+
+
+
-
- @foreach (var group in Model.SettingPageCreationContext.Groups)
- {
-
+
+ @foreach (var group in Model.SettingPageCreationContext.Groups)
+ {
+
- @group.DisplayName
-
- @await Component.InvokeAsync(group.ComponentType)
-
- }
-
-
-
-
\ No newline at end of file
+ @group.DisplayName
+
+ @await Component.InvokeAsync(group.ComponentType)
+
+ }
+
+
+
+
\ No newline at end of file
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
index b4d9324a10..bef5707d83 100644
--- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
@@ -14,6 +14,7 @@
+
@@ -25,7 +26,6 @@
-
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Navigation/AbpTenantManagementWebMainMenuContributor.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Navigation/AbpTenantManagementWebMainMenuContributor.cs
index 63dee4f7f7..b7ef9f277e 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Navigation/AbpTenantManagementWebMainMenuContributor.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Navigation/AbpTenantManagementWebMainMenuContributor.cs
@@ -16,11 +16,13 @@ namespace Volo.Abp.TenantManagement.Web.Navigation
return;
}
+ var administrationMenu = context.Menu.GetAdministration();
+
var authorizationService = context.ServiceProvider.GetRequiredService();
var l = context.ServiceProvider.GetRequiredService>();
var tenantManagementMenuItem = new ApplicationMenuItem(TenantManagementMenuNames.GroupName, l["Menu:TenantManagement"], icon: "fa fa-users");
- context.Menu.AddItem(tenantManagementMenuItem);
+ administrationMenu.AddItem(tenantManagementMenuItem);
if (await authorizationService.IsGrantedAsync(TenantManagementPermissions.Tenants.Default))
{
diff --git a/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs b/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs
index 108b3f4278..1b95984e4b 100644
--- a/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs
+++ b/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs
@@ -1,12 +1,11 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.Users.EntityFrameworkCore
{
public static class AbpUsersDbContextModelCreatingExtensions
{
- public static void ConfigureAbpUser(this EntityTypeBuilder b, ModelBuilderConfigurationOptions options)
+ public static void ConfigureAbpUser(this EntityTypeBuilder b)
where TUser : class, IUser
{
b.Property(u => u.TenantId).HasColumnName(nameof(IUser.TenantId));
diff --git a/samples/MicroserviceDemo/k8s/auth-server-deployment.yaml b/samples/MicroserviceDemo/k8s/auth-server-deployment.yaml
index 7ddbc30309..81a4b5c64d 100644
--- a/samples/MicroserviceDemo/k8s/auth-server-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/auth-server-deployment.yaml
@@ -1,33 +1,31 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: auth-server
name: auth-server
spec:
+ selector:
+ matchLabels:
+ app: auth-server
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: auth-server
+ app: auth-server
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:51511
- - name: ConnectionStrings__Default
- value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- - name: RabbitMQ__Connections__Default__HostName
- value: rabbitmq
- - name: Redis__Configuration
- value: redis
- image: volosoft/microservice-demo-auth-server
- name: auth-server
- ports:
- - containerPort: 51511
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: auth-server
+ image: "volosoft/microservice-demo-auth-server"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:51511
+ - name: ConnectionStrings__Default
+ value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
+ - name: RabbitMQ__Connections__Default__HostName
+ value: rabbitmq
+ - name: Redis__Configuration
+ value: redis
+ ports:
+ - name: http
+ containerPort: 51511
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/auth-server-service.yaml b/samples/MicroserviceDemo/k8s/auth-server-service.yaml
index d317ba1fae..1ff487ac16 100644
--- a/samples/MicroserviceDemo/k8s/auth-server-service.yaml
+++ b/samples/MicroserviceDemo/k8s/auth-server-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: auth-server
name: auth-server
spec:
- ports:
- - port: 51511
- targetPort: 51511
selector:
- io.kompose.service: auth-server
-status:
- loadBalancer: {}
+ app: auth-server
+ ports:
+ - protocol: TCP
+ port: 51511
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/backend-admin-app-deployment.yaml b/samples/MicroserviceDemo/k8s/backend-admin-app-deployment.yaml
index f26cb02806..4f0f3d4602 100644
--- a/samples/MicroserviceDemo/k8s/backend-admin-app-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/backend-admin-app-deployment.yaml
@@ -1,33 +1,31 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: backend-admin-app
name: backend-admin-app
spec:
+ selector:
+ matchLabels:
+ app: backend-admin-app
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: backend-admin-app
+ app: backend-admin-app
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: Redis__Configuration
- value: redis
- - name: RemoteServices__Default__BaseUrl
- value: http://backend-admin-app-gateway/
- image: volosoft/microservice-demo-backend-admin-app
- name: backend-admin-app
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: backend-admin-app
+ image: "volosoft/microservice-demo-backend-admin-app"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: Redis__Configuration
+ value: redis
+ - name: RemoteServices__Default__BaseUrl
+ value: http://backend-admin-app-gateway/
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-deployment.yaml b/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-deployment.yaml
index c2f28623b2..21d4260a98 100644
--- a/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-deployment.yaml
@@ -1,45 +1,43 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: backend-admin-app-gateway
name: backend-admin-app-gateway
spec:
+ selector:
+ matchLabels:
+ app: backend-admin-app-gateway
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: backend-admin-app-gateway
+ app: backend-admin-app-gateway
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: ConnectionStrings__Default
- value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- - name: GlobalConfiguration__BaseUrl
- value: http://backend-admin-app-gateway
- - name: ReRoutes__0__DownstreamHostAndPorts__0__Host
- value: identity-service
- - name: ReRoutes__0__DownstreamHostAndPorts__0__Port
- value: "80"
- - name: ReRoutes__1__DownstreamHostAndPorts__0__Host
- value: product-service
- - name: ReRoutes__1__DownstreamHostAndPorts__0__Port
- value: "80"
- - name: Redis__Configuration
- value: redis
- - name: RemoteServices__Default__BaseUrl
- value: http://backend-admin-app-gateway/
- image: volosoft/microservice-demo-backend-admin-app-gateway
- name: backend-admin-app-gateway
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: backend-admin-app-gateway
+ image: "volosoft/microservice-demo-backend-admin-app-gateway"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: ConnectionStrings__Default
+ value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
+ - name: GlobalConfiguration__BaseUrl
+ value: http://backend-admin-app-gateway
+ - name: ReRoutes__0__DownstreamHostAndPorts__0__Host
+ value: identity-service
+ - name: ReRoutes__0__DownstreamHostAndPorts__0__Port
+ value: "80"
+ - name: ReRoutes__1__DownstreamHostAndPorts__0__Host
+ value: product-service
+ - name: ReRoutes__1__DownstreamHostAndPorts__0__Port
+ value: "80"
+ - name: Redis__Configuration
+ value: redis
+ - name: RemoteServices__Default__BaseUrl
+ value: http://backend-admin-app-gateway/
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-service.yaml b/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-service.yaml
index 4864ee547a..d773c940d2 100644
--- a/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-service.yaml
+++ b/samples/MicroserviceDemo/k8s/backend-admin-app-gateway-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: backend-admin-app-gateway
name: backend-admin-app-gateway
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: backend-admin-app-gateway
-status:
- loadBalancer: {}
+ app: backend-admin-app-gateway
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/backend-admin-app-service.yaml b/samples/MicroserviceDemo/k8s/backend-admin-app-service.yaml
index f8df4e57de..36a28cb7a1 100644
--- a/samples/MicroserviceDemo/k8s/backend-admin-app-service.yaml
+++ b/samples/MicroserviceDemo/k8s/backend-admin-app-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: backend-admin-app
name: backend-admin-app
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: backend-admin-app
-status:
- loadBalancer: {}
+ app: backend-admin-app
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/blogging-service-deployment.yaml b/samples/MicroserviceDemo/k8s/blogging-service-deployment.yaml
index 6bf8d33a8c..5fa5c5542d 100644
--- a/samples/MicroserviceDemo/k8s/blogging-service-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/blogging-service-deployment.yaml
@@ -1,39 +1,37 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: blogging-service
name: blogging-service
spec:
+ selector:
+ matchLabels:
+ app: blogging-service
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: blogging-service
+ app: blogging-service
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: ConnectionStrings__Blogging
- value: mongodb://mongodb|MsDemo_Blogging
- - name: ConnectionStrings__Default
- value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- - name: RabbitMQ__Connections__Default__HostName
- value: rabbitmq
- - name: Redis__Configuration
- value: redis
- - name: RemoteServices__Default__BaseUrl
- value: http://internal-gateway/
- image: volosoft/microservice-demo-blogging-service
- name: blogging-service
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: blogging-service
+ image: "volosoft/microservice-demo-blogging-service"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: ConnectionStrings__Blogging
+ value: mongodb://mongodb|MsDemo_Blogging
+ - name: ConnectionStrings__Default
+ value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
+ - name: RabbitMQ__Connections__Default__HostName
+ value: rabbitmq
+ - name: Redis__Configuration
+ value: redis
+ - name: RemoteServices__Default__BaseUrl
+ value: http://internal-gateway/
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/blogging-service-service.yaml b/samples/MicroserviceDemo/k8s/blogging-service-service.yaml
index c2b359580a..4e756c01d7 100644
--- a/samples/MicroserviceDemo/k8s/blogging-service-service.yaml
+++ b/samples/MicroserviceDemo/k8s/blogging-service-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: blogging-service
name: blogging-service
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: blogging-service
-status:
- loadBalancer: {}
+ app: blogging-service
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/dbdata-persistentvolumeclaim.yaml b/samples/MicroserviceDemo/k8s/dbdata-persistentvolumeclaim.yaml
index cfed8b93e2..6ba0609fb4 100644
--- a/samples/MicroserviceDemo/k8s/dbdata-persistentvolumeclaim.yaml
+++ b/samples/MicroserviceDemo/k8s/dbdata-persistentvolumeclaim.yaml
@@ -1,8 +1,6 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
- labels:
- io.kompose.service: dbdata
name: dbdata
spec:
accessModes:
@@ -10,4 +8,3 @@ spec:
resources:
requests:
storage: 500Mi
-status: {}
diff --git a/samples/MicroserviceDemo/k8s/expose-service.yaml b/samples/MicroserviceDemo/k8s/expose-service.yaml
index f7a7e7dfe5..b1b668a533 100644
--- a/samples/MicroserviceDemo/k8s/expose-service.yaml
+++ b/samples/MicroserviceDemo/k8s/expose-service.yaml
@@ -1,13 +1,11 @@
apiVersion: v1
kind: Service
metadata:
- labels:
- io.kompose.service: auth-server
name: auth-server-expose
spec:
type: LoadBalancer
selector:
- io.kompose.service: auth-server
+ app: auth-server
ports:
- protocol: TCP
port: 51511
@@ -17,13 +15,11 @@ spec:
apiVersion: v1
kind: Service
metadata:
- labels:
- io.kompose.service: backend-admin-app
name: backend-admin-app-expose
spec:
type: LoadBalancer
selector:
- io.kompose.service: backend-admin-app
+ app: backend-admin-app
ports:
- protocol: TCP
port: 80
@@ -33,13 +29,11 @@ spec:
apiVersion: v1
kind: Service
metadata:
- labels:
- io.kompose.service: public-website
name: public-website-expose
spec:
type: LoadBalancer
selector:
- io.kompose.service: public-website
+ app: public-website
ports:
- protocol: TCP
port: 80
diff --git a/samples/MicroserviceDemo/k8s/identity-service-deployment.yaml b/samples/MicroserviceDemo/k8s/identity-service-deployment.yaml
index 6179f57e44..add7d662c3 100644
--- a/samples/MicroserviceDemo/k8s/identity-service-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/identity-service-deployment.yaml
@@ -1,35 +1,33 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: identity-service
name: identity-service
spec:
+ selector:
+ matchLabels:
+ app: identity-service
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: identity-service
+ app: identity-service
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: ConnectionStrings__Default
- value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- - name: RabbitMQ__Connections__Default__HostName
- value: rabbitmq
- - name: Redis__Configuration
- value: redis
- image: volosoft/microservice-demo-identity-service
- name: identity-service
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: identity-service
+ image: "volosoft/microservice-demo-identity-service"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: ConnectionStrings__Default
+ value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
+ - name: RabbitMQ__Connections__Default__HostName
+ value: rabbitmq
+ - name: Redis__Configuration
+ value: redis
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/identity-service-service.yaml b/samples/MicroserviceDemo/k8s/identity-service-service.yaml
index 994f120b0b..6157e27437 100644
--- a/samples/MicroserviceDemo/k8s/identity-service-service.yaml
+++ b/samples/MicroserviceDemo/k8s/identity-service-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: identity-service
name: identity-service
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: identity-service
-status:
- loadBalancer: {}
+ app: identity-service
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/internal-gateway-deployment.yaml b/samples/MicroserviceDemo/k8s/internal-gateway-deployment.yaml
index 9c7edf6cdb..e748456a64 100644
--- a/samples/MicroserviceDemo/k8s/internal-gateway-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/internal-gateway-deployment.yaml
@@ -1,47 +1,45 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: internal-gateway
name: internal-gateway
spec:
+ selector:
+ matchLabels:
+ app: internal-gateway
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: internal-gateway
+ app: internal-gateway
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: ConnectionStrings__Default
- value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- - name: GlobalConfiguration__BaseUrl
- value: http://internal-gateway
- - name: ReRoutes__0__DownstreamHostAndPorts__0__Host
- value: identity-service
- - name: ReRoutes__0__DownstreamHostAndPorts__0__Port
- value: "80"
- - name: ReRoutes__1__DownstreamHostAndPorts__0__Host
- value: product-service
- - name: ReRoutes__1__DownstreamHostAndPorts__0__Port
- value: "80"
- - name: ReRoutes__2__DownstreamHostAndPorts__0__Host
- value: blogging-service
- - name: ReRoutes__2__DownstreamHostAndPorts__0__Port
- value: "80"
- - name: Redis__Configuration
- value: redis
- image: volosoft/microservice-demo-internal-gateway
- name: internal-gateway
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: internal-gateway
+ image: "volosoft/microservice-demo-internal-gateway"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: ConnectionStrings__Default
+ value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
+ - name: GlobalConfiguration__BaseUrl
+ value: http://internal-gateway
+ - name: ReRoutes__0__DownstreamHostAndPorts__0__Host
+ value: identity-service
+ - name: ReRoutes__0__DownstreamHostAndPorts__0__Port
+ value: "80"
+ - name: ReRoutes__1__DownstreamHostAndPorts__0__Host
+ value: product-service
+ - name: ReRoutes__1__DownstreamHostAndPorts__0__Port
+ value: "80"
+ - name: ReRoutes__2__DownstreamHostAndPorts__0__Host
+ value: blogging-service
+ - name: ReRoutes__2__DownstreamHostAndPorts__0__Port
+ value: "80"
+ - name: Redis__Configuration
+ value: redis
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/internal-gateway-service.yaml b/samples/MicroserviceDemo/k8s/internal-gateway-service.yaml
index e2766c3c3a..b0d80b34a1 100644
--- a/samples/MicroserviceDemo/k8s/internal-gateway-service.yaml
+++ b/samples/MicroserviceDemo/k8s/internal-gateway-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: internal-gateway
name: internal-gateway
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: internal-gateway
-status:
- loadBalancer: {}
+ app: internal-gateway
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/mongodb-deployment.yaml b/samples/MicroserviceDemo/k8s/mongodb-deployment.yaml
index 938af49960..dbe3b9bde2 100644
--- a/samples/MicroserviceDemo/k8s/mongodb-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/mongodb-deployment.yaml
@@ -1,22 +1,19 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: mongodb
name: mongodb
spec:
+ selector:
+ matchLabels:
+ app: mongodb
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: mongodb
+ app: mongodb
spec:
containers:
- - image: mongo
- name: mongodb
- ports:
- - containerPort: 27017
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: mongodb
+ image: "mongo"
+ ports:
+ - containerPort: 27017
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/mongodb-service.yaml b/samples/MicroserviceDemo/k8s/mongodb-service.yaml
index 34958fb121..0752ee87ca 100644
--- a/samples/MicroserviceDemo/k8s/mongodb-service.yaml
+++ b/samples/MicroserviceDemo/k8s/mongodb-service.yaml
@@ -1,14 +1,10 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: mongodb
name: mongodb
spec:
+ selector:
+ app: mongodb
ports:
- port: 27017
- targetPort: 27017
- selector:
- io.kompose.service: mongodb
-status:
- loadBalancer: {}
+ targetPort: 27017
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/product-service-deployment.yaml b/samples/MicroserviceDemo/k8s/product-service-deployment.yaml
index 669de15ae1..238c7ea45f 100644
--- a/samples/MicroserviceDemo/k8s/product-service-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/product-service-deployment.yaml
@@ -1,38 +1,36 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: product-service
name: product-service
spec:
+ selector:
+ matchLabels:
+ app: product-service
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: product-service
+ app: product-service
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: ConnectionStrings__Default
- value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated
- Security=false
- - name: ConnectionStrings__ProductManagement
- value: Server=sqlserver;Database=MsDemo_ProductManagement;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- - name: RabbitMQ__Connections__Default__HostName
- value: rabbitmq
- - name: Redis__Configuration
- value: redis
- image: volosoft/microservice-demo-product-service
- name: product-service
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: product-service
+ image: "volosoft/microservice-demo-product-service"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: ConnectionStrings__Default
+ value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated
+ Security=false
+ - name: ConnectionStrings__ProductManagement
+ value: Server=sqlserver;Database=MsDemo_ProductManagement;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
+ - name: RabbitMQ__Connections__Default__HostName
+ value: rabbitmq
+ - name: Redis__Configuration
+ value: redis
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/product-service-service.yaml b/samples/MicroserviceDemo/k8s/product-service-service.yaml
index 3c5d1f333b..b420f35361 100644
--- a/samples/MicroserviceDemo/k8s/product-service-service.yaml
+++ b/samples/MicroserviceDemo/k8s/product-service-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: product-service
name: product-service
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: product-service
-status:
- loadBalancer: {}
+ app: product-service
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/public-website-deployment.yaml b/samples/MicroserviceDemo/k8s/public-website-deployment.yaml
index c643f68b99..321ad14565 100644
--- a/samples/MicroserviceDemo/k8s/public-website-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/public-website-deployment.yaml
@@ -1,33 +1,31 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: public-website
name: public-website
spec:
+ selector:
+ matchLabels:
+ app: public-website
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: public-website
+ app: public-website
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: Redis__Configuration
- value: redis
- - name: RemoteServices__Default__BaseUrl
- value: http://public-website-gateway/
- image: volosoft/microservice-demo-public-website
- name: public-website
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: public-website
+ image: "volosoft/microservice-demo-public-website"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: Redis__Configuration
+ value: redis
+ - name: RemoteServices__Default__BaseUrl
+ value: http://public-website-gateway/
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/public-website-gateway-deployment.yaml b/samples/MicroserviceDemo/k8s/public-website-gateway-deployment.yaml
index 802f12a7e3..43804ea78a 100644
--- a/samples/MicroserviceDemo/k8s/public-website-gateway-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/public-website-gateway-deployment.yaml
@@ -1,43 +1,41 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: public-website-gateway
name: public-website-gateway
spec:
+ selector:
+ matchLabels:
+ app: public-website-gateway
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: public-website-gateway
+ app: public-website-gateway
spec:
containers:
- - env:
- - name: ASPNETCORE_ENVIRONMENT
- value: Development
- - name: ASPNETCORE_URLS
- value: http://0.0.0.0:80
- - name: AuthServer__Authority
- value: http://auth-server:51511
- - name: ConnectionStrings__Default
- value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- - name: GlobalConfiguration__BaseUrl
- value: http://public-website-gateway
- - name: ReRoutes__0__DownstreamHostAndPorts__0__Host
- value: product-service
- - name: ReRoutes__0__DownstreamHostAndPorts__0__Port
- value: "80"
- - name: ReRoutes__1__DownstreamHostAndPorts__0__Host
- value: blogging-service
- - name: ReRoutes__1__DownstreamHostAndPorts__0__Port
- value: "80"
- - name: Redis__Configuration
- value: redis
- image: volosoft/microservice-demo-public-website-gateway
- name: public-website-gateway
- ports:
- - containerPort: 80
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: public-website-gateway
+ image: "volosoft/microservice-demo-public-website-gateway"
+ env:
+ - name: ASPNETCORE_ENVIRONMENT
+ value: Development
+ - name: ASPNETCORE_URLS
+ value: http://0.0.0.0:80
+ - name: AuthServer__Authority
+ value: http://auth-server:51511
+ - name: ConnectionStrings__Default
+ value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
+ - name: GlobalConfiguration__BaseUrl
+ value: http://public-website-gateway
+ - name: ReRoutes__0__DownstreamHostAndPorts__0__Host
+ value: product-service
+ - name: ReRoutes__0__DownstreamHostAndPorts__0__Port
+ value: "80"
+ - name: ReRoutes__1__DownstreamHostAndPorts__0__Host
+ value: blogging-service
+ - name: ReRoutes__1__DownstreamHostAndPorts__0__Port
+ value: "80"
+ - name: Redis__Configuration
+ value: redis
+ ports:
+ - name: http
+ containerPort: 80
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/public-website-gateway-service.yaml b/samples/MicroserviceDemo/k8s/public-website-gateway-service.yaml
index 5ab4e428b9..d04c680685 100644
--- a/samples/MicroserviceDemo/k8s/public-website-gateway-service.yaml
+++ b/samples/MicroserviceDemo/k8s/public-website-gateway-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: public-website-gateway
name: public-website-gateway
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: public-website-gateway
-status:
- loadBalancer: {}
+ app: public-website-gateway
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/public-website-service.yaml b/samples/MicroserviceDemo/k8s/public-website-service.yaml
index 5f5c4f56d9..5ac586cb19 100644
--- a/samples/MicroserviceDemo/k8s/public-website-service.yaml
+++ b/samples/MicroserviceDemo/k8s/public-website-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: public-website
name: public-website
spec:
- ports:
- - port: 80
- targetPort: 80
selector:
- io.kompose.service: public-website
-status:
- loadBalancer: {}
+ app: public-website
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: http
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/rabbitmq-deployment.yaml b/samples/MicroserviceDemo/k8s/rabbitmq-deployment.yaml
index e455bebac6..283b1601a9 100644
--- a/samples/MicroserviceDemo/k8s/rabbitmq-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/rabbitmq-deployment.yaml
@@ -1,23 +1,20 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: rabbitmq
name: rabbitmq
spec:
+ selector:
+ matchLabels:
+ app: rabbitmq
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: rabbitmq
+ app: rabbitmq
spec:
containers:
- - image: rabbitmq:3-management-alpine
- name: rabbitmq
- ports:
- - containerPort: 5672
- - containerPort: 15672
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: rabbitmq
+ image: "rabbitmq:3-management-alpine"
+ ports:
+ - containerPort: 5672
+ - containerPort: 15672
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/rabbitmq-service.yaml b/samples/MicroserviceDemo/k8s/rabbitmq-service.yaml
index b8595193e8..07e7b2a618 100644
--- a/samples/MicroserviceDemo/k8s/rabbitmq-service.yaml
+++ b/samples/MicroserviceDemo/k8s/rabbitmq-service.yaml
@@ -1,18 +1,14 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: rabbitmq
name: rabbitmq
spec:
+ selector:
+ app: rabbitmq
ports:
- name: "5672"
port: 5672
targetPort: 5672
- name: "15672"
port: 15672
- targetPort: 15672
- selector:
- io.kompose.service: rabbitmq
-status:
- loadBalancer: {}
+ targetPort: 15672
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/redis-deployment.yaml b/samples/MicroserviceDemo/k8s/redis-deployment.yaml
index 35d9973110..5f0c6e50e4 100644
--- a/samples/MicroserviceDemo/k8s/redis-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/redis-deployment.yaml
@@ -1,22 +1,19 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: redis
name: redis
spec:
+ selector:
+ matchLabels:
+ app: redis
replicas: 1
- strategy: {}
template:
metadata:
labels:
- io.kompose.service: redis
+ app: redis
spec:
containers:
- - image: redis
- name: redis
- ports:
- - containerPort: 6379
- resources: {}
- restartPolicy: Always
-status: {}
+ - name: redis
+ image: "redis"
+ ports:
+ - containerPort: 6379
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/redis-service.yaml b/samples/MicroserviceDemo/k8s/redis-service.yaml
index 8ef5014d20..8fef057052 100644
--- a/samples/MicroserviceDemo/k8s/redis-service.yaml
+++ b/samples/MicroserviceDemo/k8s/redis-service.yaml
@@ -1,14 +1,10 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: redis
name: redis
spec:
- ports:
- - port: 6379
- targetPort: 6379
selector:
- io.kompose.service: redis
-status:
- loadBalancer: {}
+ app: redis
+ ports:
+ - port: 6379
+ targetPort: 6379
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/restore-database-job.yaml b/samples/MicroserviceDemo/k8s/restore-database-job.yaml
index b35b67844f..fa403e95d8 100644
--- a/samples/MicroserviceDemo/k8s/restore-database-job.yaml
+++ b/samples/MicroserviceDemo/k8s/restore-database-job.yaml
@@ -12,7 +12,7 @@ spec:
- name: SA_PASSWORD
value: yourStrong(!)Password
name: restore-database
- image: volosoft/microservice-demo-restore-database
+ image: "volosoft/microservice-demo-restore-database"
volumeMounts:
- mountPath: /var/opt/mssql
name: dbdata
diff --git a/samples/MicroserviceDemo/k8s/sqlserver-deployment.yaml b/samples/MicroserviceDemo/k8s/sqlserver-deployment.yaml
index 1de273530e..e95ce99ee7 100644
--- a/samples/MicroserviceDemo/k8s/sqlserver-deployment.yaml
+++ b/samples/MicroserviceDemo/k8s/sqlserver-deployment.yaml
@@ -1,35 +1,35 @@
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
- labels:
- io.kompose.service: sqlserver
name: sqlserver
spec:
+ selector:
+ matchLabels:
+ app: sqlserver
replicas: 1
- strategy:
- type: Recreate
template:
metadata:
labels:
- io.kompose.service: sqlserver
+ app: sqlserver
spec:
containers:
- - env:
+ - name: sqlserver
+ image: mcr.microsoft.com/mssql/server
+ ports:
+ - containerPort: 1433
+ env:
+ - name: MSSQL_PID
+ value: "Developer"
- name: ACCEPT_EULA
value: "Y"
- name: SA_PASSWORD
value: yourStrong(!)Password
- image: mcr.microsoft.com/mssql/server
- name: sqlserver
- ports:
- - containerPort: 1433
- resources: {}
+ - name: MSSQL_SA_PASSWORD
+ value: yourStrong(!)Password
volumeMounts:
- - mountPath: /var/opt/mssql
- name: dbdata
- restartPolicy: Always
+ - name: dbdata
+ mountPath: /var/opt/mssql
volumes:
- name: dbdata
persistentVolumeClaim:
- claimName: dbdata
-status: {}
+ claimName: dbdata
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/k8s/sqlserver-service.yaml b/samples/MicroserviceDemo/k8s/sqlserver-service.yaml
index da4a98c85a..a72adb2567 100644
--- a/samples/MicroserviceDemo/k8s/sqlserver-service.yaml
+++ b/samples/MicroserviceDemo/k8s/sqlserver-service.yaml
@@ -1,14 +1,11 @@
-apiVersion: v1
kind: Service
+apiVersion: v1
metadata:
- labels:
- io.kompose.service: sqlserver
name: sqlserver
spec:
- ports:
- - port: 1433
- targetPort: 1433
selector:
- io.kompose.service: sqlserver
-status:
- loadBalancer: {}
+ app: sqlserver
+ ports:
+ - protocol: TCP
+ port: 1433
+ targetPort: 1433
\ No newline at end of file
diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement/ProductAppService.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement/ProductAppService.cs
index 25a596b24e..6cdf82f22a 100644
--- a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement/ProductAppService.cs
+++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement/ProductAppService.cs
@@ -28,7 +28,7 @@ namespace ProductManagement
await NormalizeMaxResultCountAsync(input);
var products = await _productRepository
- .OrderBy(input.Sorting)
+ .OrderBy(input.Sorting ?? "Name")
.Skip(input.SkipCount)
.Take(input.MaxResultCount)
.ToListAsync();
diff --git a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190107113413_Initial.Designer.cs b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.Designer.cs
similarity index 99%
rename from templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190107113413_Initial.Designer.cs
rename to templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.Designer.cs
index 8d0c81b5f8..91a4c096ff 100644
--- a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190107113413_Initial.Designer.cs
+++ b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.Designer.cs
@@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.DemoApp;
namespace MyCompanyName.MyProjectName.DemoApp.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
- [Migration("20190107113413_Initial")]
+ [Migration("20190320125012_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
diff --git a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190107113413_Initial.cs b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.cs
similarity index 100%
rename from templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190107113413_Initial.cs
rename to templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.cs
diff --git a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj
index 4e019c6d9b..041d6cf9ce 100644
--- a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj
+++ b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj
@@ -35,4 +35,8 @@
+
+
+
+
diff --git a/templates/mvc/MyCompanyName.MyProjectName.sln b/templates/mvc/MyCompanyName.MyProjectName.sln
index ed0f5881c3..0c616dbc3b 100644
--- a/templates/mvc/MyCompanyName.MyProjectName.sln
+++ b/templates/mvc/MyCompanyName.MyProjectName.sln
@@ -19,7 +19,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Web.Tests", "test\MyCompanyName.MyProjectName.Web.Tests\MyCompanyName.MyProjectName.Web.Tests.csproj", "{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.MongoDB", "src\MyCompanyName.MyProjectName.MongoDB\MyCompanyName.MyProjectName.MongoDB.csproj", "{E3444355-D47E-431E-BDD0-DD3A7113B2AE}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.MongoDB", "src\MyCompanyName.MyProjectName.MongoDB\MyCompanyName.MyProjectName.MongoDB.csproj", "{E3444355-D47E-431E-BDD0-DD3A7113B2AE}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations", "src\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj", "{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -55,6 +57,10 @@ Global
{E3444355-D47E-431E-BDD0-DD3A7113B2AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3444355-D47E-431E-BDD0-DD3A7113B2AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3444355-D47E-431E-BDD0-DD3A7113B2AE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -67,6 +73,7 @@ Global
{50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{E3444355-D47E-431E-BDD0-DD3A7113B2AE} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
+ {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
diff --git a/templates/mvc/common.props b/templates/mvc/common.props
new file mode 100644
index 0000000000..7585f303ba
--- /dev/null
+++ b/templates/mvc/common.props
@@ -0,0 +1,7 @@
+
+
+ latest
+ 1.0.0
+ $(NoWarn);CS1591
+
+
\ No newline at end of file
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj
index 70b63090cc..f774c93818 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj
@@ -1,5 +1,7 @@
+
+
netcoreapp2.2
MyCompanyName.MyProjectName
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj
index 258847de37..32d5d55698 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj
@@ -1,5 +1,7 @@
+
+
netcoreapp2.2
MyCompanyName.MyProjectName
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameConsts.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameConsts.cs
new file mode 100644
index 0000000000..d939cfca9f
--- /dev/null
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameConsts.cs
@@ -0,0 +1,9 @@
+namespace MyCompanyName.MyProjectName
+{
+ public static class MyProjectNameConsts
+ {
+ public const string DbTablePrefix = "App";
+
+ public const string DbSchema = null;
+ }
+}
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs
index 565e4f8d5f..5fca840175 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs
@@ -1,5 +1,4 @@
using MyCompanyName.MyProjectName.Localization.MyProjectName;
-using MyCompanyName.MyProjectName.Settings;
using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
@@ -8,7 +7,6 @@ using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.Identity;
-using Volo.Abp.Settings;
using Volo.Abp.VirtualFileSystem;
namespace MyCompanyName.MyProjectName
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs
new file mode 100644
index 0000000000..587c9d9440
--- /dev/null
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs
@@ -0,0 +1,53 @@
+using System;
+using Volo.Abp.Domain.Entities.Auditing;
+using Volo.Abp.Users;
+
+namespace MyCompanyName.MyProjectName.Users
+{
+ /* This entity shares the same table/collection ("AbpUsers" by default) with the
+ * IdentityUser entity of the Identity module.
+ *
+ * - You can define your custom properties into this class.
+ * - You never create or delete this entity, becase it is Identity module's job.
+ * - You can query users from database with this entity.
+ * - You can update values of your custom properties.
+ */
+ public class AppUser : FullAuditedAggregateRoot, IUser
+ {
+ #region Base properties
+
+ /* These properties are shared with the IdentityUser entity of the Identity module.
+ * Do not change these properties through this class. Instead, use Identity module
+ * services (like IdentityUserManager) to change them.
+ * So, this properties are designed as read only!
+ */
+
+ public virtual Guid? TenantId { get; private set; }
+
+ public virtual string UserName { get; private set; }
+
+ public virtual string Name { get; private set; }
+
+ public virtual string Surname { get; private set; }
+
+ public virtual string Email { get; private set; }
+
+ public virtual bool EmailConfirmed { get; private set; }
+
+ public virtual string PhoneNumber { get; private set; }
+
+ public virtual bool PhoneNumberConfirmed { get; private set; }
+
+ #endregion
+
+ /* Add your own properties here. Example:
+ *
+ * public virtual string MyProperty { get; set; }
+ */
+
+ private AppUser()
+ {
+
+ }
+ }
+}
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs
new file mode 100644
index 0000000000..5fe35526b0
--- /dev/null
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs
@@ -0,0 +1,44 @@
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.AuditLogging.EntityFrameworkCore;
+using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore;
+using Volo.Abp.Identity;
+using Volo.Abp.Identity.EntityFrameworkCore;
+using Volo.Abp.PermissionManagement.EntityFrameworkCore;
+using Volo.Abp.SettingManagement.EntityFrameworkCore;
+
+namespace MyCompanyName.MyProjectName.EntityFrameworkCore
+{
+ public class MyProjectNameMigrationsDbContext : AbpDbContext
+ {
+ public MyProjectNameMigrationsDbContext(DbContextOptions options)
+ : base(options)
+ {
+
+ }
+
+ protected override void OnModelCreating(ModelBuilder builder)
+ {
+ base.OnModelCreating(builder);
+
+ /* Include modules to your migration db context */
+
+ builder.ConfigurePermissionManagement();
+ builder.ConfigureSettingManagement();
+ builder.ConfigureBackgroundJobs();
+ builder.ConfigureAuditLogging();
+ builder.ConfigureIdentity();
+
+ /* Configure customizations for entities from the modules included */
+
+ builder.Entity(b =>
+ {
+ b.ConfigureCustomUserProperties();
+ });
+
+ /* Configure your own tables/entities inside the ConfigureMyProjectName method */
+
+ builder.ConfigureMyProjectName();
+ }
+ }
+}
\ No newline at end of file
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContextFactory.cs
similarity index 64%
rename from templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
rename to templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContextFactory.cs
index c878f12fd5..d760790fc8 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContextFactory.cs
@@ -5,22 +5,22 @@ using Microsoft.Extensions.Configuration;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
- public class MyProjectNameDbContextFactory : IDesignTimeDbContextFactory
+ public class MyProjectNameMigrationsDbContextFactory : IDesignTimeDbContextFactory
{
- public MyProjectNameDbContext CreateDbContext(string[] args)
+ public MyProjectNameMigrationsDbContext CreateDbContext(string[] args)
{
var configuration = BuildConfiguration();
- var builder = new DbContextOptionsBuilder()
+ var builder = new DbContextOptionsBuilder()
.UseSqlServer(configuration.GetConnectionString("Default"));
- return new MyProjectNameDbContext(builder.Options);
+ return new MyProjectNameMigrationsDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
- .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../MyCompanyName.MyProjectName.Web/"))
+ .SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false);
return builder.Build();
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20190211104804_Initial.Designer.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190320072839_Initial.Designer.cs
similarity index 99%
rename from templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20190211104804_Initial.Designer.cs
rename to templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190320072839_Initial.Designer.cs
index 2002970aad..b25ddbee04 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20190211104804_Initial.Designer.cs
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190320072839_Initial.Designer.cs
@@ -9,15 +9,15 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
- [DbContext(typeof(MyProjectNameDbContext))]
- [Migration("20190211104804_Initial")]
+ [DbContext(typeof(MyProjectNameMigrationsDbContext))]
+ [Migration("20190320072839_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
- .HasAnnotation("ProductVersion", "2.2.1-servicing-10028")
+ .HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20190211104804_Initial.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190320072839_Initial.cs
similarity index 100%
rename from templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20190211104804_Initial.cs
rename to templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190320072839_Initial.cs
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs
similarity index 99%
rename from templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs
rename to templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs
index 1d2a225f38..43def4fbad 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs
@@ -8,14 +8,14 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
- [DbContext(typeof(MyProjectNameDbContext))]
- partial class MyProjectNameDbContextModelSnapshot : ModelSnapshot
+ [DbContext(typeof(MyProjectNameMigrationsDbContext))]
+ partial class MyProjectNameMigrationsDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
- .HasAnnotation("ProductVersion", "2.2.1-servicing-10028")
+ .HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj
new file mode 100644
index 0000000000..b38b78dbd2
--- /dev/null
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj
@@ -0,0 +1,14 @@
+
+
+
+
+
+ netcoreapp2.2
+ MyCompanyName.MyProjectName
+
+
+
+
+
+
+
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
index f26ede167b..b96691dcc7 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
@@ -1,32 +1,45 @@
using Microsoft.EntityFrameworkCore;
-using Volo.Abp.AuditLogging.EntityFrameworkCore;
-using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
+using MyCompanyName.MyProjectName.Users;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
-using Volo.Abp.Identity.EntityFrameworkCore;
-using Volo.Abp.PermissionManagement.EntityFrameworkCore;
-using Volo.Abp.SettingManagement.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Volo.Abp.Users.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
[ConnectionStringName("Default")]
public class MyProjectNameDbContext : AbpDbContext
{
+ public DbSet Users { get; set; }
+
public MyProjectNameDbContext(DbContextOptions options)
: base(options)
{
}
- protected override void OnModelCreating(ModelBuilder modelBuilder)
+ protected override void OnModelCreating(ModelBuilder builder)
{
- base.OnModelCreating(modelBuilder);
+ base.OnModelCreating(builder);
+
+ /* Configure the shared tables (with included modules) here */
+
+ builder.Entity(b =>
+ {
+ b.ToTable("AbpUsers"); //Sharing the same table "AbpUsers" with the IdentityUser
+
+ b.ConfigureFullAudited();
+ b.ConfigureExtraProperties();
+ b.ConfigureConcurrencyStamp();
+ b.ConfigureAbpUser();
+
+ //Moved customization to a method so we can share it with the MyProjectNameMigrationsDbContext class
+ b.ConfigureCustomUserProperties();
+ });
+
+ /* Configure your own tables/entities inside the ConfigureMyProjectName method */
- modelBuilder.ConfigureIdentity();
- modelBuilder.ConfigurePermissionManagement();
- modelBuilder.ConfigureSettingManagement();
- modelBuilder.ConfigureBackgroundJobs();
- modelBuilder.ConfigureAuditLogging();
+ builder.ConfigureMyProjectName();
}
}
}
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs
new file mode 100644
index 0000000000..3528ed5279
--- /dev/null
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using Volo.Abp;
+using Volo.Abp.Users;
+
+namespace MyCompanyName.MyProjectName.EntityFrameworkCore
+{
+ public static class MyProjectNameDbContextModelCreatingExtensions
+ {
+ public static void ConfigureMyProjectName(this ModelBuilder builder)
+ {
+ Check.NotNull(builder, nameof(builder));
+
+ /* Configure your own tables/entities inside here */
+
+ //builder.Entity(b =>
+ //{
+ // b.ToTable(MyProjectNameConsts.DbTablePrefix + "YourEntities", MyProjectNameConsts.DbSchema);
+
+ // //...
+ //});
+ }
+
+ public static void ConfigureCustomUserProperties(this EntityTypeBuilder b)
+ where TUser: class, IUser
+ {
+ //b.Property(nameof(AppUser.MyProperty))...
+ }
+ }
+}
\ No newline at end of file
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
index debec3acbe..30b78df34e 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
@@ -1,13 +1,11 @@
+
+
netcoreapp2.2
MyCompanyName.MyProjectName
-
-
-
-
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs b/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs
index 19c21ca038..95a041809f 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs
@@ -1,4 +1,6 @@
-using Volo.Abp.Data;
+using MongoDB.Driver;
+using MyCompanyName.MyProjectName.Users;
+using Volo.Abp.Data;
using Volo.Abp.MongoDB;
namespace MyCompanyName.MyProjectName.MongoDb
@@ -6,6 +8,16 @@ namespace MyCompanyName.MyProjectName.MongoDb
[ConnectionStringName("Default")]
public class MyProjectNameMongoDbContext : AbpMongoDbContext
{
-
+ public IMongoCollection Users => Collection();
+
+ protected override void CreateModel(IMongoModelBuilder modelBuilder)
+ {
+ base.CreateModel(modelBuilder);
+
+ modelBuilder.Entity(b =>
+ {
+ b.CollectionName = "AbpUsers"; //Sharing the same collection "AbpUsers" with the IdentityUser
+ });
+ }
}
}
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MyCompanyName.MyProjectName.MongoDB.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MyCompanyName.MyProjectName.MongoDB.csproj
index b313a4c24d..ece0fd1b4d 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MyCompanyName.MyProjectName.MongoDB.csproj
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MyCompanyName.MyProjectName.MongoDB.csproj
@@ -1,5 +1,7 @@
+
+
netcoreapp2.2
MyCompanyName.MyProjectName
diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
index 846b262f32..f3e67ec343 100644
--- a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
+++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
@@ -1,5 +1,7 @@
+
+
netcoreapp2.2
MyCompanyName.MyProjectName
@@ -9,7 +11,6 @@
true
true
false
-
@@ -28,7 +29,7 @@
-
+
diff --git a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj
index 752b62442f..808ee9f1fe 100644
--- a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj
+++ b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj
@@ -1,5 +1,7 @@
+
+
netcoreapp2.2
MyCompanyName.MyProjectName
@@ -7,9 +9,9 @@
-
+
diff --git a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs
index 145710c15b..d44dc0bb5a 100644
--- a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs
+++ b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs
@@ -53,11 +53,11 @@ namespace MyCompanyName.MyProjectName
var connection = new SqliteConnection("Data Source=:memory:");
connection.Open();
- var options = new DbContextOptionsBuilder()
+ var options = new DbContextOptionsBuilder()
.UseSqlite(connection)
.Options;
- using (var context = new MyProjectNameDbContext(options))
+ using (var context = new MyProjectNameMigrationsDbContext(options))
{
context.GetService().CreateTables();
}
diff --git a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTest.cs b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTest.cs
deleted file mode 100644
index e0f87e86c8..0000000000
--- a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTest.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.Threading.Tasks;
-using Microsoft.Extensions.DependencyInjection;
-using Shouldly;
-using Volo.Abp.Identity;
-using Xunit;
-
-namespace MyCompanyName.MyProjectName.Samples
-{
- public class SampleTest : MyProjectNameApplicationTestBase
- {
- private readonly IIdentityUserAppService _userAppService;
-
- public SampleTest()
- {
- _userAppService = ServiceProvider.GetRequiredService();
- }
-
- [Fact]
- public async Task Initial_Data_Should_Contain_Admin_User()
- {
- var result = await _userAppService.GetListAsync(new GetIdentityUsersInput());
- result.TotalCount.ShouldBeGreaterThan(0);
- result.Items.ShouldContain(u => u.UserName == "admin");
- }
- }
-}
diff --git a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTests.cs b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTests.cs
new file mode 100644
index 0000000000..3baff2826f
--- /dev/null
+++ b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTests.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.DependencyInjection;
+using MyCompanyName.MyProjectName.Users;
+using Shouldly;
+using Volo.Abp.Domain.Repositories;
+using Volo.Abp.Identity;
+using Volo.Abp.Uow;
+using Xunit;
+
+namespace MyCompanyName.MyProjectName.Samples
+{
+ public class SampleTests : MyProjectNameApplicationTestBase
+ {
+ private readonly IIdentityUserAppService _userAppService;
+ private readonly IRepository _appUserRepository;
+ private readonly IUnitOfWorkManager _unitOfWorkManager;
+
+ public SampleTests()
+ {
+ _userAppService = ServiceProvider.GetRequiredService();
+ _appUserRepository = ServiceProvider.GetRequiredService>();
+ _unitOfWorkManager = ServiceProvider.GetRequiredService();
+ }
+
+ [Fact]
+ public async Task Initial_Data_Should_Contain_Admin_User()
+ {
+ //Act
+ var result = await _userAppService.GetListAsync(new GetIdentityUsersInput());
+
+ //Assert
+ result.TotalCount.ShouldBeGreaterThan(0);
+ result.Items.ShouldContain(u => u.UserName == "admin");
+ }
+
+ [Fact]
+ public async Task Should_Query_AppUser()
+ {
+ /* Need to manually start Unit Of Work because
+ * FirstOrDefaultAsync should be executed while db connection / context is available.
+ */
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ //Act
+ var adminUser = await _appUserRepository
+ .Where(u => u.UserName == "admin")
+ .FirstOrDefaultAsync();
+
+ //Assert
+ adminUser.ShouldNotBeNull();
+
+ await uow.CompleteAsync();
+ }
+ }
+ }
+}
diff --git a/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj b/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj
index 2a5c9f7a13..177f2da1ec 100644
--- a/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj
+++ b/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyCompanyName.MyProjectName.Web.Tests.csproj
@@ -1,5 +1,7 @@
+
+
netcoreapp2.2
Exe
diff --git a/templates/service/host/IdentityServerHost/DemoAppDbContext.cs b/templates/service/host/IdentityServerHost/DemoAppDbContext.cs
index 754cd89dff..5d418a19e0 100644
--- a/templates/service/host/IdentityServerHost/DemoAppDbContext.cs
+++ b/templates/service/host/IdentityServerHost/DemoAppDbContext.cs
@@ -1,7 +1,10 @@
using Microsoft.EntityFrameworkCore;
+using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
+using Volo.Abp.PermissionManagement.EntityFrameworkCore;
+using Volo.Abp.SettingManagement.EntityFrameworkCore;
namespace IdentityServerHost
{
@@ -17,6 +20,9 @@ namespace IdentityServerHost
{
base.OnModelCreating(modelBuilder);
+ modelBuilder.ConfigurePermissionManagement();
+ modelBuilder.ConfigureSettingManagement();
+ modelBuilder.ConfigureAuditLogging();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureIdentityServer();
}
diff --git a/templates/service/host/IdentityServerHost/IdentityServerHost.csproj b/templates/service/host/IdentityServerHost/IdentityServerHost.csproj
index c5b8c3826d..7e72681de0 100644
--- a/templates/service/host/IdentityServerHost/IdentityServerHost.csproj
+++ b/templates/service/host/IdentityServerHost/IdentityServerHost.csproj
@@ -17,6 +17,9 @@
+
+
+
@@ -26,9 +29,4 @@
-
-
-
-
-
diff --git a/templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.Designer.cs b/templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.Designer.cs
similarity index 75%
rename from templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.Designer.cs
rename to templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.Designer.cs
index 1dd595dfd1..8ef18c7e12 100644
--- a/templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.Designer.cs
+++ b/templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.Designer.cs
@@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IdentityServerHost.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
- [Migration("20190107114341_Initial")]
+ [Migration("20190320142333_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -21,6 +21,202 @@ namespace IdentityServerHost.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+ modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("ApplicationName")
+ .HasColumnName("ApplicationName")
+ .HasMaxLength(96);
+
+ b.Property("BrowserInfo")
+ .HasColumnName("BrowserInfo")
+ .HasMaxLength(512);
+
+ b.Property("ClientId")
+ .HasColumnName("ClientId")
+ .HasMaxLength(64);
+
+ b.Property("ClientIpAddress")
+ .HasColumnName("ClientIpAddress")
+ .HasMaxLength(64);
+
+ b.Property("ClientName")
+ .HasColumnName("ClientName")
+ .HasMaxLength(128);
+
+ b.Property("Comments")
+ .HasColumnName("Comments")
+ .HasMaxLength(256);
+
+ b.Property("ConcurrencyStamp");
+
+ b.Property("CorrelationId")
+ .HasColumnName("CorrelationId")
+ .HasMaxLength(64);
+
+ b.Property("Exceptions")
+ .HasColumnName("Exceptions")
+ .HasMaxLength(4000);
+
+ b.Property("ExecutionDuration")
+ .HasColumnName("ExecutionDuration");
+
+ b.Property("ExecutionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("HttpMethod")
+ .HasColumnName("HttpMethod")
+ .HasMaxLength(16);
+
+ b.Property("HttpStatusCode")
+ .HasColumnName("HttpStatusCode");
+
+ b.Property("ImpersonatorTenantId")
+ .HasColumnName("ImpersonatorTenantId");
+
+ b.Property("ImpersonatorUserId")
+ .HasColumnName("ImpersonatorUserId");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId");
+
+ b.Property("Url")
+ .HasColumnName("Url")
+ .HasMaxLength(256);
+
+ b.Property("UserId")
+ .HasColumnName("UserId");
+
+ b.Property("UserName")
+ .HasColumnName("UserName")
+ .HasMaxLength(256);
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "ExecutionTime");
+
+ b.HasIndex("TenantId", "UserId", "ExecutionTime");
+
+ b.ToTable("AbpAuditLogs");
+ });
+
+ modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("AuditLogId")
+ .HasColumnName("AuditLogId");
+
+ b.Property("ExecutionDuration")
+ .HasColumnName("ExecutionDuration");
+
+ b.Property("ExecutionTime")
+ .HasColumnName("ExecutionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("MethodName")
+ .HasColumnName("MethodName")
+ .HasMaxLength(128);
+
+ b.Property("Parameters")
+ .HasColumnName("Parameters")
+ .HasMaxLength(2000);
+
+ b.Property("ServiceName")
+ .HasColumnName("ServiceName")
+ .HasMaxLength(256);
+
+ b.Property("TenantId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuditLogId");
+
+ b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
+
+ b.ToTable("AbpAuditLogActions");
+ });
+
+ modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("AuditLogId")
+ .HasColumnName("AuditLogId");
+
+ b.Property("ChangeTime")
+ .HasColumnName("ChangeTime");
+
+ b.Property("ChangeType")
+ .HasColumnName("ChangeType");
+
+ b.Property("EntityId")
+ .IsRequired()
+ .HasColumnName("EntityId")
+ .HasMaxLength(128);
+
+ b.Property("EntityTypeFullName")
+ .IsRequired()
+ .HasColumnName("EntityTypeFullName")
+ .HasMaxLength(128);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuditLogId");
+
+ b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
+
+ b.ToTable("AbpEntityChanges");
+ });
+
+ modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("EntityChangeId");
+
+ b.Property("NewValue")
+ .HasColumnName("NewValue")
+ .HasMaxLength(512);
+
+ b.Property("OriginalValue")
+ .HasColumnName("OriginalValue")
+ .HasMaxLength(512);
+
+ b.Property("PropertyName")
+ .IsRequired()
+ .HasColumnName("PropertyName")
+ .HasMaxLength(128);
+
+ b.Property("PropertyTypeFullName")
+ .IsRequired()
+ .HasColumnName("PropertyTypeFullName")
+ .HasMaxLength(64);
+
+ b.Property("TenantId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityChangeId");
+
+ b.ToTable("AbpEntityPropertyChanges");
+ });
+
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property("Id")
@@ -445,7 +641,7 @@ namespace IdentityServerHost.Migrations
b.Property("BackChannelLogoutSessionRequired");
b.Property("BackChannelLogoutUri")
- .HasMaxLength(2000);
+ .HasMaxLength(300);
b.Property("ClientClaimsPrefix")
.HasMaxLength(200);
@@ -458,7 +654,7 @@ namespace IdentityServerHost.Migrations
.HasMaxLength(200);
b.Property("ClientUri")
- .HasMaxLength(2000);
+ .HasMaxLength(300);
b.Property("ConcurrencyStamp");
@@ -477,14 +673,14 @@ namespace IdentityServerHost.Migrations
b.Property("FrontChannelLogoutSessionRequired");
b.Property("FrontChannelLogoutUri")
- .HasMaxLength(2000);
+ .HasMaxLength(300);
b.Property("IdentityTokenLifetime");
b.Property("IncludeJwtId");
b.Property("LogoUri")
- .HasMaxLength(2000);
+ .HasMaxLength(300);
b.Property("PairWiseSubjectSalt")
.HasMaxLength(200);
@@ -517,22 +713,15 @@ namespace IdentityServerHost.Migrations
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
{
- b.Property("Id")
- .ValueGeneratedOnAdd();
-
b.Property("ClientId");
b.Property("Type")
- .IsRequired()
.HasMaxLength(250);
b.Property("Value")
- .IsRequired()
.HasMaxLength(250);
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
+ b.HasKey("ClientId", "Type", "Value");
b.ToTable("IdentityServerClientClaims");
});
@@ -578,7 +767,7 @@ namespace IdentityServerHost.Migrations
b.Property("ClientId");
b.Property("PostLogoutRedirectUri")
- .HasMaxLength(2000);
+ .HasMaxLength(200);
b.HasKey("ClientId", "PostLogoutRedirectUri");
@@ -590,11 +779,11 @@ namespace IdentityServerHost.Migrations
b.Property("ClientId");
b.Property("Key")
- .HasMaxLength(250);
+ .HasMaxLength(64);
b.Property("Value")
.IsRequired()
- .HasMaxLength(2000);
+ .HasMaxLength(128);
b.HasKey("ClientId", "Key");
@@ -606,7 +795,7 @@ namespace IdentityServerHost.Migrations
b.Property("ClientId");
b.Property("RedirectUri")
- .HasMaxLength(2000);
+ .HasMaxLength(200);
b.HasKey("ClientId", "RedirectUri");
@@ -727,6 +916,82 @@ namespace IdentityServerHost.Migrations
b.ToTable("IdentityServerIdentityResources");
});
+ modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128);
+
+ b.Property("ProviderKey")
+ .IsRequired()
+ .HasMaxLength(64);
+
+ b.Property("ProviderName")
+ .IsRequired()
+ .HasMaxLength(64);
+
+ b.Property("TenantId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name", "ProviderName", "ProviderKey");
+
+ b.ToTable("AbpPermissionGrants");
+ });
+
+ modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128);
+
+ b.Property("ProviderKey")
+ .HasMaxLength(64);
+
+ b.Property("ProviderName")
+ .HasMaxLength(64);
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(2048);
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name", "ProviderName", "ProviderKey");
+
+ b.ToTable("AbpSettings");
+ });
+
+ modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
+ {
+ b.HasOne("Volo.Abp.AuditLogging.AuditLog")
+ .WithMany("Actions")
+ .HasForeignKey("AuditLogId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
+ {
+ b.HasOne("Volo.Abp.AuditLogging.AuditLog")
+ .WithMany("EntityChanges")
+ .HasForeignKey("AuditLogId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
+ {
+ b.HasOne("Volo.Abp.AuditLogging.EntityChange")
+ .WithMany("PropertyChanges")
+ .HasForeignKey("EntityChangeId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")
diff --git a/templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.cs b/templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.cs
similarity index 77%
rename from templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.cs
rename to templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.cs
index ddb2f14c1c..88588fb970 100644
--- a/templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.cs
+++ b/templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.cs
@@ -7,6 +7,37 @@ namespace IdentityServerHost.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
+ migrationBuilder.CreateTable(
+ name: "AbpAuditLogs",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ ExtraProperties = table.Column(nullable: true),
+ ConcurrencyStamp = table.Column(nullable: true),
+ ApplicationName = table.Column(maxLength: 96, nullable: true),
+ UserId = table.Column(nullable: true),
+ UserName = table.Column(maxLength: 256, nullable: true),
+ TenantId = table.Column(nullable: true),
+ ImpersonatorUserId = table.Column(nullable: true),
+ ImpersonatorTenantId = table.Column(nullable: true),
+ ExecutionTime = table.Column(nullable: false),
+ ExecutionDuration = table.Column(nullable: false),
+ ClientIpAddress = table.Column(maxLength: 64, nullable: true),
+ ClientName = table.Column(maxLength: 128, nullable: true),
+ ClientId = table.Column(maxLength: 64, nullable: true),
+ CorrelationId = table.Column(maxLength: 64, nullable: true),
+ BrowserInfo = table.Column(maxLength: 512, nullable: true),
+ HttpMethod = table.Column(maxLength: 16, nullable: true),
+ Url = table.Column(maxLength: 256, nullable: true),
+ Exceptions = table.Column(maxLength: 4000, nullable: true),
+ Comments = table.Column(maxLength: 256, nullable: true),
+ HttpStatusCode = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
@@ -27,6 +58,21 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "AbpPermissionGrants",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ TenantId = table.Column(nullable: true),
+ Name = table.Column(maxLength: 128, nullable: false),
+ ProviderName = table.Column(maxLength: 64, nullable: false),
+ ProviderKey = table.Column(maxLength: 64, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
@@ -46,6 +92,21 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "AbpSettings",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ Name = table.Column(maxLength: 128, nullable: false),
+ Value = table.Column(maxLength: 2048, nullable: false),
+ ProviderName = table.Column(maxLength: 64, nullable: true),
+ ProviderKey = table.Column(maxLength: 64, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpSettings", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
@@ -109,8 +170,8 @@ namespace IdentityServerHost.Migrations
ClientId = table.Column(maxLength: 200, nullable: false),
ClientName = table.Column(maxLength: 200, nullable: true),
Description = table.Column(maxLength: 1000, nullable: true),
- ClientUri = table.Column(maxLength: 2000, nullable: true),
- LogoUri = table.Column(maxLength: 2000, nullable: true),
+ ClientUri = table.Column(maxLength: 300, nullable: true),
+ LogoUri = table.Column(maxLength: 300, nullable: true),
Enabled = table.Column(nullable: false),
ProtocolType = table.Column(maxLength: 200, nullable: false),
RequireClientSecret = table.Column(nullable: false),
@@ -120,9 +181,9 @@ namespace IdentityServerHost.Migrations
RequirePkce = table.Column(nullable: false),
AllowPlainTextPkce = table.Column(nullable: false),
AllowAccessTokensViaBrowser = table.Column(nullable: false),
- FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true),
+ FrontChannelLogoutUri = table.Column(maxLength: 300, nullable: true),
FrontChannelLogoutSessionRequired = table.Column(nullable: false),
- BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true),
+ BackChannelLogoutUri = table.Column(maxLength: 300, nullable: true),
BackChannelLogoutSessionRequired = table.Column(nullable: false),
AllowOfflineAccess = table.Column(nullable: false),
IdentityTokenLifetime = table.Column(nullable: false),
@@ -186,6 +247,55 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
});
+ migrationBuilder.CreateTable(
+ name: "AbpAuditLogActions",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ TenantId = table.Column(nullable: true),
+ AuditLogId = table.Column(nullable: false),
+ ServiceName = table.Column(maxLength: 256, nullable: true),
+ MethodName = table.Column(maxLength: 128, nullable: true),
+ Parameters = table.Column(maxLength: 2000, nullable: true),
+ ExecutionTime = table.Column(nullable: false),
+ ExecutionDuration = table.Column(nullable: false),
+ ExtraProperties = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
+ column: x => x.AuditLogId,
+ principalTable: "AbpAuditLogs",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AbpEntityChanges",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ AuditLogId = table.Column(nullable: false),
+ TenantId = table.Column(nullable: true),
+ ChangeTime = table.Column(nullable: false),
+ ChangeType = table.Column(nullable: false),
+ EntityId = table.Column(maxLength: 128, nullable: false),
+ EntityTypeFullName = table.Column(maxLength: 128, nullable: false),
+ ExtraProperties = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
+ column: x => x.AuditLogId,
+ principalTable: "AbpAuditLogs",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
@@ -361,14 +471,13 @@ namespace IdentityServerHost.Migrations
name: "IdentityServerClientClaims",
columns: table => new
{
- Id = table.Column(nullable: false),
ClientId = table.Column(nullable: false),
Type = table.Column(maxLength: 250, nullable: false),
Value = table.Column(maxLength: 250, nullable: false)
},
constraints: table =>
{
- table.PrimaryKey("PK_IdentityServerClientClaims", x => x.Id);
+ table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId",
column: x => x.ClientId,
@@ -436,7 +545,7 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column(nullable: false),
- PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false)
+ PostLogoutRedirectUri = table.Column(maxLength: 200, nullable: false)
},
constraints: table =>
{
@@ -454,8 +563,8 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column(nullable: false),
- Key = table.Column(maxLength: 250, nullable: false),
- Value = table.Column(maxLength: 2000, nullable: false)
+ Key = table.Column(maxLength: 64, nullable: false),
+ Value = table.Column(maxLength: 128, nullable: false)
},
constraints: table =>
{
@@ -473,7 +582,7 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column(nullable: false),
- RedirectUri = table.Column(maxLength: 2000, nullable: false)
+ RedirectUri = table.Column(maxLength: 200, nullable: false)
},
constraints: table =>
{
@@ -543,6 +652,29 @@ namespace IdentityServerHost.Migrations
onDelete: ReferentialAction.Cascade);
});
+ migrationBuilder.CreateTable(
+ name: "AbpEntityPropertyChanges",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ TenantId = table.Column(nullable: true),
+ EntityChangeId = table.Column(nullable: false),
+ NewValue = table.Column(maxLength: 512, nullable: true),
+ OriginalValue = table.Column(maxLength: 512, nullable: true),
+ PropertyName = table.Column(maxLength: 128, nullable: false),
+ PropertyTypeFullName = table.Column(maxLength: 64, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
+ column: x => x.EntityChangeId,
+ principalTable: "AbpEntityChanges",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
@@ -562,6 +694,46 @@ namespace IdentityServerHost.Migrations
onDelete: ReferentialAction.Cascade);
});
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAuditLogActions_AuditLogId",
+ table: "AbpAuditLogActions",
+ column: "AuditLogId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
+ table: "AbpAuditLogActions",
+ columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
+ table: "AbpAuditLogs",
+ columns: new[] { "TenantId", "ExecutionTime" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
+ table: "AbpAuditLogs",
+ columns: new[] { "TenantId", "UserId", "ExecutionTime" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpEntityChanges_AuditLogId",
+ table: "AbpEntityChanges",
+ column: "AuditLogId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
+ table: "AbpEntityChanges",
+ columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpEntityPropertyChanges_EntityChangeId",
+ table: "AbpEntityPropertyChanges",
+ column: "EntityChangeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
+ table: "AbpPermissionGrants",
+ columns: new[] { "Name", "ProviderName", "ProviderKey" });
+
migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
@@ -572,6 +744,11 @@ namespace IdentityServerHost.Migrations
table: "AbpRoles",
column: "NormalizedName");
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
+ table: "AbpSettings",
+ columns: new[] { "Name", "ProviderName", "ProviderKey" });
+
migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
table: "AbpUserClaims",
@@ -607,11 +784,6 @@ namespace IdentityServerHost.Migrations
table: "AbpUsers",
column: "UserName");
- migrationBuilder.CreateIndex(
- name: "IX_IdentityServerClientClaims_ClientId",
- table: "IdentityServerClientClaims",
- column: "ClientId");
-
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
@@ -626,12 +798,24 @@ namespace IdentityServerHost.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
+ migrationBuilder.DropTable(
+ name: "AbpAuditLogActions");
+
migrationBuilder.DropTable(
name: "AbpClaimTypes");
+ migrationBuilder.DropTable(
+ name: "AbpEntityPropertyChanges");
+
+ migrationBuilder.DropTable(
+ name: "AbpPermissionGrants");
+
migrationBuilder.DropTable(
name: "AbpRoleClaims");
+ migrationBuilder.DropTable(
+ name: "AbpSettings");
+
migrationBuilder.DropTable(
name: "AbpUserClaims");
@@ -686,6 +870,9 @@ namespace IdentityServerHost.Migrations
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
+ migrationBuilder.DropTable(
+ name: "AbpEntityChanges");
+
migrationBuilder.DropTable(
name: "AbpRoles");
@@ -701,6 +888,9 @@ namespace IdentityServerHost.Migrations
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
+ migrationBuilder.DropTable(
+ name: "AbpAuditLogs");
+
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
}
diff --git a/templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs b/templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs
index 2a102778ee..1aec48ea05 100644
--- a/templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs
+++ b/templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs
@@ -19,6 +19,202 @@ namespace IdentityServerHost.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+ modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("ApplicationName")
+ .HasColumnName("ApplicationName")
+ .HasMaxLength(96);
+
+ b.Property("BrowserInfo")
+ .HasColumnName("BrowserInfo")
+ .HasMaxLength(512);
+
+ b.Property("ClientId")
+ .HasColumnName("ClientId")
+ .HasMaxLength(64);
+
+ b.Property("ClientIpAddress")
+ .HasColumnName("ClientIpAddress")
+ .HasMaxLength(64);
+
+ b.Property("ClientName")
+ .HasColumnName("ClientName")
+ .HasMaxLength(128);
+
+ b.Property("Comments")
+ .HasColumnName("Comments")
+ .HasMaxLength(256);
+
+ b.Property