' +
@@ -433,13 +441,13 @@
return '';
}
-
+
function createInitialAbpDate(date, options) {
date = convertToMoment(date, options, undefined, options.isUtc);
if (options.isUtc) {
date = date.local();
}
-
+
return AbpDate(date, options);
}
@@ -468,8 +476,9 @@
var singleOpenAndClearButton = options.singleOpenAndClearButton && $clearButton.length > 0 && $openButton.length > 0;
var startDate = createInitialAbpDate(options.startDate || options.date || (options.autoUpdateInput ? new Date() : undefined), options);
+
var oldStartDate = AbpDate(undefined, options);
-
+
var endDate = createInitialAbpDate(options.endDate || (options.autoUpdateInput ? new Date() : undefined), options);
var oldEndDate = AbpDate(undefined, options);
@@ -544,6 +553,10 @@
triggerDateChange($input, startDate, isDateRangePickerTrigger);
}
}
+
+ if(isTrigger || isInputTrigger || isDateRangePickerTrigger){
+ triggerValidation();
+ }
}
function setDataDates(date, $selfInput, prefix){
@@ -553,6 +566,25 @@
$input.data(prefix + 'date', date);
}
+ function triggerValidation() {
+ checkValidity($startDateInput);
+ checkValidity($endDateInput);
+ checkValidity($dateInput);
+ checkValidity($input);
+ }
+
+ function checkValidity($selfInput) {
+ if (!$selfInput) {
+ return;
+ }
+
+ if($selfInput.closest('form').length === 0) {
+ return;
+ }
+
+ $selfInput.valid();
+ }
+
function triggerDateChange($selfInput, value, isDateRangePickerTrigger) {
$selfInput.trigger('change');
if(isDateRangePickerTrigger !== false){
@@ -583,7 +615,7 @@
}else{
picker.setStartDate(convertToMoment(startDate, options, options.inputDateFormat));
}
-
+
if(singleDatePicker){
picker.setEndDate(picker.startDate);
}else if(isEmptyDate(endDate, options)){
diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs
index 30b32c3587..f9f5284b29 100644
--- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs
+++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs
@@ -53,6 +53,12 @@ public class AbpAuditingOptions
public IEntityHistorySelectorList EntityHistorySelectors { get; }
+ ///
+ /// Default: true.
+ /// Save entity changes to audit log when any navigation property changes.
+ ///
+ public bool SaveEntityHistoryWhenNavigationChanges { get; set; } = true;
+
//TODO: Move this to asp.net core layer or convert it to a more dynamic strategy?
///
/// Default: false.
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs
index 971deab5ca..a87436510b 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs
@@ -1,6 +1,7 @@
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Cli.Commands;
+using Volo.Abp.Cli.Commands.Internal;
using Volo.Abp.Cli.Http;
using Volo.Abp.Cli.ServiceProxying;
using Volo.Abp.Cli.ServiceProxying.Angular;
@@ -68,6 +69,7 @@ public class AbpCliCoreModule : AbpModule
options.Commands[CleanCommand.Name] = typeof(CleanCommand);
options.Commands[CliCommand.Name] = typeof(CliCommand);
options.Commands[ClearDownloadCacheCommand.Name] = typeof(ClearDownloadCacheCommand);
+ options.Commands[RecreateInitialMigrationCommand.Name] = typeof(RecreateInitialMigrationCommand);
options.DisabledModulesToAddToSolution.Add("Volo.Abp.LeptonXTheme.Pro");
options.DisabledModulesToAddToSolution.Add("Volo.Abp.LeptonXTheme.Lite");
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs
new file mode 100644
index 0000000000..a0a374a89a
--- /dev/null
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs
@@ -0,0 +1,89 @@
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
+using Volo.Abp.Cli.Args;
+using Volo.Abp.Cli.Utils;
+using Volo.Abp.DependencyInjection;
+
+namespace Volo.Abp.Cli.Commands.Internal;
+
+public class RecreateInitialMigrationCommand : IConsoleCommand, ITransientDependency
+{
+ public const string Name = "recreate-initial-migration";
+
+ public ILogger Logger { get; set; }
+
+ protected CmdHelper CmdHelper { get; }
+
+ public RecreateInitialMigrationCommand(CmdHelper cmdHelper)
+ {
+ CmdHelper = cmdHelper;
+ Logger = NullLogger.Instance;
+ }
+
+ public virtual Task ExecuteAsync(CommandLineArgs commandLineArgs)
+ {
+ var csprojFiles = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.csproj", SearchOption.AllDirectories)
+ .Where(x => x.Contains("templates") || x.Contains("test-app"))
+ .Where(x => File.ReadAllText(x).Contains("Microsoft.EntityFrameworkCore.Tools")).ToList();
+
+ var projectCounts = 0;
+ foreach (var csprojFile in csprojFiles)
+ {
+ var projectDir = Path.GetDirectoryName(csprojFile)!;
+
+ if (!Directory.Exists(Path.Combine(projectDir, "Migrations")))
+ {
+ continue;
+ }
+
+ Logger.LogInformation($"Recreating migrations for {csprojFile}");
+
+ if (Directory.Exists(Path.Combine(projectDir, "Migrations")))
+ {
+ Directory.Delete(Path.Combine(projectDir, "Migrations"), true);
+ }
+
+ var separateDbContext = false;
+ if (Directory.Exists(Path.Combine(projectDir, "TenantMigrations")))
+ {
+ Directory.Delete(Path.Combine(projectDir, "TenantMigrations"), true);
+ separateDbContext = true;
+ }
+ if (!separateDbContext)
+ {
+ CmdHelper.RunCmd($"dotnet ef migrations add Initial", workingDirectory: projectDir);
+ }
+ else
+ {
+ CmdHelper.RunCmd($"dotnet ef migrations add Initial --context MyProjectNameDbContext", workingDirectory: projectDir);
+ CmdHelper.RunCmd($"dotnet ef migrations add Initial --context MyProjectNameTenantDbContext --output-dir TenantMigrations", workingDirectory: projectDir);
+ }
+
+ if (Directory.Exists(Path.Combine(projectDir, "Logs")))
+ {
+ Directory.Delete(Path.Combine(projectDir, "Logs"), true);
+ }
+
+ projectCounts++;
+ }
+
+ Logger.LogInformation(projectCounts > 0
+ ? $"Done! All {projectCounts} migrations recreated."
+ : "No project found to recreate migrations.");
+
+ return Task.CompletedTask;
+ }
+
+ public string GetUsageInfo()
+ {
+ return GetShortDescription();
+ }
+
+ public string GetShortDescription()
+ {
+ return "This is a internal command. Please run 'abp recreate-initial-migration' command in abp or volo root directory.";
+ }
+}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
index b6408fb3e2..4a88ada34a 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
@@ -372,7 +372,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
return;
}
- lines[lineIndex] = lines[lineIndex].Replace(lines[lineIndex], $"\t");
+ lines[lineIndex] = lines[lineIndex].Replace(lines[lineIndex], $"\t\t\n");
file.SetLines(lines);
}
@@ -568,7 +568,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
private static void ChangeThemeToBasicForMvcProjects(ProjectBuildContext context, string defaultThemeName)
{
var projectNames = new[]
-{
+ {
".Web", ".HttpApi.Host", ".AuthServer", ".Web.Public", ".Web.Public.Host",
"" //for app-nolayers-mvc
};
@@ -608,45 +608,46 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
{
var projects = new Dictionary
{
- {"Blazor", "MyProjectNameBlazorModule"},
- {"Blazor.Server.Tiered", "MyProjectNameBlazorModule"},
- {"Blazor.Server", "MyProjectNameModule"},
- {"Blazor.Server.Mongo", "MyProjectNameModule"}
+ {".Blazor", "MyProjectNameBlazorModule"},
+ {".Blazor.Server.Tiered", "MyProjectNameBlazorModule"},
+ {".Blazor.Server", "MyProjectNameModule"},
+ {"Blazor.Server.Mongo", "MyProjectNameModule"},
+ {"", ""} //for app-nolayers blazor-server
};
foreach (var project in projects)
{
ReplacePackageReferenceWithProjectReference(
context,
- $"/MyCompanyName.MyProjectName.{project.Key}/MyCompanyName.MyProjectName.{project.Key}.csproj",
- $"Volo.Abp.AspNetCore.Components.Server.{defaultThemeName}Theme",
- @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
+ $"/MyCompanyName.MyProjectName{project.Key}/MyCompanyName.MyProjectName{project.Key}.csproj",
+ $"Volo.Abp.AspNetCore.Components.Server.{defaultThemeName}",
+ @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj"
);
ReplacePackageReferenceWithProjectReference(
context,
- $"/MyCompanyName.MyProjectName.{project.Key}/MyCompanyName.MyProjectName.{project.Key}.csproj",
+ $"/MyCompanyName.MyProjectName{project.Key}/MyCompanyName.MyProjectName{project.Key}.csproj",
$"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}",
- @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj"
+ @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj"
);
ReplaceAllKeywords(
context,
- $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml",
+ $"/Pages/_Host.cshtml",
$"{defaultThemeName}Theme.Components",
Basic
);
ReplaceAllKeywords(
context,
- $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs",
+ $"/MyCompanyName.MyProjectName{project.Key}/{project.Value}.cs",
defaultThemeName,
- Basic
+ Basic + "Theme"
);
ReplaceAllKeywords(
context,
- $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml",
+ $"/Pages/_Host.cshtml",
defaultThemeName,
Basic
);
@@ -682,7 +683,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
ReplaceAllKeywords(
context,
- $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml",
+ $"/Pages/_Host.cshtml",
LeptonX,
Lepton
);
@@ -731,7 +732,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep
ReplaceAllKeywords(
context,
- $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml",
+ $"/Pages/_Host.cshtml",
LeptonX,
Lepton
);
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs
index 7bbba5c733..8b9df09ca5 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs
@@ -346,6 +346,7 @@ public abstract class AppNoLayersTemplateBase : TemplateInfo
var blazorServerUiPackageName = isProTemplate ? "@volo/aspnetcore.components.server.leptonxtheme" : "@abp/aspnetcore.components.server.leptonxlitetheme";
var blazorServerPackageJsonFilePaths = new List
{
+ "/MyCompanyName.MyProjectName/package.json",
"/MyCompanyName.MyProjectName.Blazor/package.json",
"/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json"
};
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
index ba85c48aeb..08152db2f8 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
@@ -594,10 +594,11 @@ public class SolutionModuleAdder : ITransientDependency
{
var args = new CommandLineArgs("new", module.Name);
- args.Options.Add("t", newProTemplate ? ModuleProTemplate.TemplateName : ModuleTemplate.TemplateName);
- args.Options.Add("v", version);
- args.Options.Add("o", Path.Combine(modulesFolderInSolution, module.Name));
- args.Options.Add("sib", true.ToString());
+ args.Options.Add(ProjectCreationCommandBase.Options.Template.Short, newProTemplate ? ModuleProTemplate.TemplateName : ModuleTemplate.TemplateName);
+ args.Options.Add(ProjectCreationCommandBase.Options.Version.Short, version);
+ args.Options.Add(ProjectCreationCommandBase.Options.OutputFolder.Short, Path.Combine(modulesFolderInSolution, module.Name));
+ args.Options.Add(ProjectCreationCommandBase.Options.SkipInstallingLibs.Short, true.ToString());
+ args.Options.Add(ProjectCreationCommandBase.Options.SkipBundling.Long, true.ToString());
await NewCommand.ExecuteAsync(args);
}
diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/EntityHistory/EntityHistoryHelper.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/EntityHistory/EntityHistoryHelper.cs
index dc3754be3b..5229e9aab6 100644
--- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/EntityHistory/EntityHistoryHelper.cs
+++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/EntityHistory/EntityHistoryHelper.cs
@@ -85,7 +85,7 @@ public class EntityHistoryHelper : IEntityHistoryHelper, ITransientDependency
case EntityState.Modified:
changeType = IsDeleted(entityEntry) ? EntityChangeType.Deleted : EntityChangeType.Updated;
break;
- case EntityState.Unchanged:
+ case EntityState.Unchanged when HasNavigationPropertiesChanged(entityEntry):
changeType = EntityChangeType.Updated; // Navigation property changes.
break;
case EntityState.Detached:
@@ -186,7 +186,7 @@ public class EntityHistoryHelper : IEntityHistoryHelper, ITransientDependency
}
}
- if (entityEntry.State == EntityState.Unchanged)
+ if (Options.SaveEntityHistoryWhenNavigationChanges && entityEntry.State == EntityState.Unchanged)
{
foreach (var navigation in entityEntry.Navigations)
{
@@ -227,21 +227,6 @@ public class EntityHistoryHelper : IEntityHistoryHelper, ITransientDependency
return false;
}
- if (entityEntry.State == EntityState.Unchanged)
- {
- if (entityEntry.Navigations.Any(navigationEntry => navigationEntry.IsModified))
- {
- return true;
- }
-
- if (entityEntry.Navigations.Where(x => x is ReferenceEntry).Cast().Any(x => x.TargetEntry != null && x.TargetEntry.State == EntityState.Modified))
- {
- return true;
- }
-
- return false;
- }
-
var entityType = entityEntry.Metadata.ClrType;
if (!EntityHelper.IsEntity(entityType) && !EntityHelper.IsValueObject(entityType))
@@ -249,12 +234,20 @@ public class EntityHistoryHelper : IEntityHistoryHelper, ITransientDependency
return false;
}
- if (AuditingHelper.IsEntityHistoryEnabled(entityType))
+ var isEntityHistoryEnabled = AuditingHelper.IsEntityHistoryEnabled(entityType);
+ if (isEntityHistoryEnabled && HasNavigationPropertiesChanged(entityEntry))
{
return true;
}
- return defaultValue;
+ return isEntityHistoryEnabled || defaultValue;
+ }
+
+ protected virtual bool HasNavigationPropertiesChanged(EntityEntry entityEntry)
+ {
+ return Options.SaveEntityHistoryWhenNavigationChanges && entityEntry.State == EntityState.Unchanged &&
+ (entityEntry.Navigations.Any(navigationEntry => navigationEntry.IsModified) ||
+ entityEntry.Navigations.Where(x => x is ReferenceEntry).Cast().Any(x => x.TargetEntry != null && x.TargetEntry.State == EntityState.Modified));
}
protected virtual bool ShouldSavePropertyHistory(PropertyEntry propertyEntry, bool defaultValue)
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
index 59814ff3be..c8ba277ccc 100644
--- 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
@@ -1,11 +1,13 @@
+using System;
using JetBrains.Annotations;
using System.Linq;
-using Volo.Abp.UI.Navigation;
namespace Volo.Abp.UI.Navigation;
public static class ApplicationMenuExtensions
{
+ public const string CustomDataComponentKey = "ApplicationMenu.CustomComponent";
+
[NotNull]
public static ApplicationMenuItem GetAdministration(
[NotNull] this ApplicationMenu applicationMenu)
@@ -112,4 +114,24 @@ public static class ApplicationMenuExtensions
return menuWithGroups;
}
+
+ public static ApplicationMenuItem UseComponent(this ApplicationMenuItem applicationMenuItem)
+ {
+ return applicationMenuItem.UseComponent(typeof(TComponent));
+ }
+
+ public static ApplicationMenuItem UseComponent(this ApplicationMenuItem applicationMenuItem, Type componentType)
+ {
+ return applicationMenuItem.WithCustomData(CustomDataComponentKey, componentType);
+ }
+
+ public static Type? GetComponentTypeOrDefault(this ApplicationMenuItem applicationMenuItem)
+ {
+ if (applicationMenuItem.CustomData.TryGetValue(CustomDataComponentKey, out var value))
+ {
+ return value as Type;
+ }
+
+ return default;
+ }
}
diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs
index 7154fd805c..a5060dc595 100644
--- a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs
+++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using NSubstitute;
@@ -392,6 +391,7 @@ public class Auditing_Tests : AbpAuditingTestBase
x.EntityChanges[1].EntityTypeFullName == typeof(AppEntityWithValueObject).FullName &&
x.EntityChanges[2].ChangeType == EntityChangeType.Deleted &&
x.EntityChanges[2].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName));
+ AuditingStore.ClearReceivedCalls();
#pragma warning restore 4014
using (var scope = _auditingManager.BeginScope())
@@ -421,7 +421,7 @@ public class Auditing_Tests : AbpAuditingTestBase
x.EntityChanges[1].EntityTypeFullName == typeof(AppEntityWithValueObject).FullName &&
x.EntityChanges[1].PropertyChanges.Count == 1 &&
x.EntityChanges[1].PropertyChanges[0].PropertyName == nameof(AppEntityWithValueObject.AppEntityWithValueObjectAddress)));
-
+ AuditingStore.ClearReceivedCalls();
#pragma warning restore 4014
using (var scope = _auditingManager.BeginScope())
@@ -439,22 +439,16 @@ public class Auditing_Tests : AbpAuditingTestBase
}
#pragma warning disable 4014
- AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 2 &&
- x.EntityChanges[0].ChangeType == EntityChangeType.Updated &&
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Deleted &&
x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName &&
- x.EntityChanges[0].PropertyChanges.Count == 1 &&
- x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithValueObjectAddress.Country) &&
- x.EntityChanges[0].PropertyChanges[0].OriginalValue == "\"England\"" &&
- x.EntityChanges[0].PropertyChanges[0].NewValue == "\"Germany\"" &&
-
- x.EntityChanges[1].ChangeType == EntityChangeType.Updated &&
- x.EntityChanges[1].EntityTypeFullName == typeof(AppEntityWithValueObject).FullName));
-
+ x.EntityChanges[0].PropertyChanges.Count == 2 &&
+ x.EntityChanges[0].PropertyChanges.All(p => p.NewValue == null)));
#pragma warning restore 4014
}
[Fact]
- public virtual async Task Should_Write_AuditLog_For_Navigations_Changes()
+ public virtual async Task Should_Write_AuditLog_For_Navigation_Changes()
{
var entityId = Guid.NewGuid();
var repository = ServiceProvider.GetRequiredService>();
@@ -484,6 +478,7 @@ public class Auditing_Tests : AbpAuditingTestBase
x.EntityChanges[0].PropertyChanges[0].NewValue == "\"test full name\"" &&
x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithNavigations.FullName) &&
x.EntityChanges[0].PropertyChanges[0].PropertyTypeFullName == typeof(string).FullName));
+ AuditingStore.ClearReceivedCalls();
#pragma warning restore 4014
using (var scope = _auditingManager.BeginScope())
@@ -513,6 +508,7 @@ public class Auditing_Tests : AbpAuditingTestBase
x.EntityChanges[1].PropertyChanges.Count == 1 &&
x.EntityChanges[1].PropertyChanges[0].PropertyName == nameof(AppEntityWithNavigations.OneToOne) &&
x.EntityChanges[1].PropertyChanges[0].PropertyTypeFullName == typeof(AppEntityWithNavigationChildOneToOne).FullName));
+ AuditingStore.ClearReceivedCalls();
#pragma warning restore 4014
using (var scope = _auditingManager.BeginScope())
@@ -545,7 +541,7 @@ public class Auditing_Tests : AbpAuditingTestBase
x.EntityChanges[1].PropertyChanges.Count == 1 &&
x.EntityChanges[1].PropertyChanges[0].PropertyName == nameof(AppEntityWithNavigations.OneToMany) &&
x.EntityChanges[1].PropertyChanges[0].PropertyTypeFullName == typeof(List).FullName));
-
+ AuditingStore.ClearReceivedCalls();
#pragma warning restore 4014
using (var scope = _auditingManager.BeginScope())
@@ -604,3 +600,234 @@ public class Auditing_DisableLogActionInfo_Tests : Auditing_Tests
await AuditingStore.Received().SaveAsync(Arg.Is(x => x.Actions.IsNullOrEmpty()));
}
}
+
+public class Auditing_SaveEntityHistoryWhenNavigationChanges_Tests : AbpAuditingTestBase
+{
+ protected IAuditingStore AuditingStore;
+ private IAuditingManager _auditingManager;
+ private IUnitOfWorkManager _unitOfWorkManager;
+
+ public Auditing_SaveEntityHistoryWhenNavigationChanges_Tests()
+ {
+ _auditingManager = GetRequiredService();
+ _unitOfWorkManager = GetRequiredService();
+ }
+
+ protected override void AfterAddApplication(IServiceCollection services)
+ {
+ AuditingStore = Substitute.For();
+ services.Replace(ServiceDescriptor.Singleton(AuditingStore));
+
+ services.Configure(options =>
+ {
+ options.SaveEntityHistoryWhenNavigationChanges = false;
+ });
+ }
+
+ [Fact]
+ public virtual async Task Should_Write_AuditLog_For_ValueObject_Entity()
+ {
+ var entityId = Guid.NewGuid();
+ var repository = ServiceProvider.GetRequiredService>();
+ await repository.InsertAsync(new AppEntityWithValueObject(entityId, "test name", new AppEntityWithValueObjectAddress("USA")));
+
+ using (var scope = _auditingManager.BeginScope())
+ {
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ var entity = await repository.GetAsync(entityId);
+ entity.Name = "test name 2";
+ entity.AppEntityWithValueObjectAddress = new AppEntityWithValueObjectAddress("England");
+
+ await repository.UpdateAsync(entity);
+
+ await uow.CompleteAsync();
+ await scope.SaveAsync();
+ }
+ }
+
+#pragma warning disable 4014
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 3 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Created &&
+ x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName &&
+ x.EntityChanges[1].ChangeType == EntityChangeType.Updated &&
+ x.EntityChanges[1].EntityTypeFullName == typeof(AppEntityWithValueObject).FullName &&
+ x.EntityChanges[2].ChangeType == EntityChangeType.Deleted &&
+ x.EntityChanges[2].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName));
+ AuditingStore.ClearReceivedCalls();
+#pragma warning restore 4014
+
+ using (var scope = _auditingManager.BeginScope())
+ {
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ var entity = await repository.GetAsync(entityId);
+
+ entity.AppEntityWithValueObjectAddress.Country = "Germany";
+
+ await repository.UpdateAsync(entity);
+ await uow.CompleteAsync();
+ await scope.SaveAsync();
+ }
+ }
+
+#pragma warning disable 4014
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Updated &&
+ x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName &&
+ x.EntityChanges[0].PropertyChanges.Count == 1 &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithValueObjectAddress.Country) &&
+ x.EntityChanges[0].PropertyChanges[0].OriginalValue == "\"England\"" &&
+ x.EntityChanges[0].PropertyChanges[0].NewValue == "\"Germany\""));
+ AuditingStore.ClearReceivedCalls();
+#pragma warning restore 4014
+
+ using (var scope = _auditingManager.BeginScope())
+ {
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ var entity = await repository.GetAsync(entityId);
+
+ entity.AppEntityWithValueObjectAddress = null;
+
+ await repository.UpdateAsync(entity);
+ await uow.CompleteAsync();
+ await scope.SaveAsync();
+ }
+ }
+
+#pragma warning disable 4014
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Deleted &&
+ x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithValueObjectAddress).FullName &&
+ x.EntityChanges[0].PropertyChanges.Count == 2 &&
+ x.EntityChanges[0].PropertyChanges.All(p => p.NewValue == null)));
+#pragma warning restore 4014
+ }
+
+ [Fact]
+ public virtual async Task Should_Not_Write_AuditLog_For_Navigation_Changes()
+ {
+ var entityId = Guid.NewGuid();
+ var repository = ServiceProvider.GetRequiredService>();
+ await repository.InsertAsync(new AppEntityWithNavigations(entityId, "test name"));
+
+ using (var scope = _auditingManager.BeginScope())
+ {
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ var entity = await repository.GetAsync(entityId);
+
+ entity.FullName = "test full name";
+
+ await repository.UpdateAsync(entity);
+
+ await uow.CompleteAsync();
+ await scope.SaveAsync();
+ }
+ }
+
+#pragma warning disable 4014
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Updated &&
+ x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithNavigations).FullName &&
+ x.EntityChanges[0].PropertyChanges.Count == 1 &&
+ x.EntityChanges[0].PropertyChanges[0].OriginalValue == "\"test name\"" &&
+ x.EntityChanges[0].PropertyChanges[0].NewValue == "\"test full name\"" &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithNavigations.FullName) &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyTypeFullName == typeof(string).FullName));
+ AuditingStore.ClearReceivedCalls();
+#pragma warning restore 4014
+
+ using (var scope = _auditingManager.BeginScope())
+ {
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ var entity = await repository.GetAsync(entityId);
+
+ entity.OneToOne = new AppEntityWithNavigationChildOneToOne
+ {
+ ChildName = "ChildName"
+ };
+
+ await repository.UpdateAsync(entity);
+
+ await uow.CompleteAsync();
+ await scope.SaveAsync();
+ }
+ }
+
+#pragma warning disable 4014
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Created &&
+ x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithNavigationChildOneToOne).FullName &&
+ x.EntityChanges[0].PropertyChanges.Count == 1 &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithNavigationChildOneToOne.ChildName) &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyTypeFullName == typeof(string).FullName));
+ AuditingStore.ClearReceivedCalls();
+#pragma warning restore 4014
+
+ using (var scope = _auditingManager.BeginScope())
+ {
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ var entity = await repository.GetAsync(entityId);
+
+ entity.OneToMany = new List()
+ {
+ new AppEntityWithNavigationChildOneToMany
+ {
+ AppEntityWithNavigationId = entity.Id,
+ ChildName = "ChildName1"
+ }
+ };
+
+ await repository.UpdateAsync(entity);
+ await uow.CompleteAsync();
+ await scope.SaveAsync();
+ }
+ }
+
+#pragma warning disable 4014
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Created &&
+ x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithNavigationChildOneToMany).FullName &&
+ x.EntityChanges[0].PropertyChanges.Count == 2 &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithNavigationChildOneToMany.AppEntityWithNavigationId) &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyTypeFullName == typeof(Guid).FullName &&
+ x.EntityChanges[0].PropertyChanges[1].PropertyName == nameof(AppEntityWithNavigationChildOneToMany.ChildName) &&
+ x.EntityChanges[0].PropertyChanges[1].PropertyTypeFullName == typeof(string).FullName));
+ AuditingStore.ClearReceivedCalls();
+#pragma warning restore 4014
+
+ using (var scope = _auditingManager.BeginScope())
+ {
+ using (var uow = _unitOfWorkManager.Begin())
+ {
+ var entity = await repository.GetAsync(entityId);
+
+ entity.ManyToMany = new List()
+ {
+ new AppEntityWithNavigationChildManyToMany
+ {
+ ChildName = "ChildName1"
+ }
+ };
+
+ await repository.UpdateAsync(entity);
+ await uow.CompleteAsync();
+ await scope.SaveAsync();
+ }
+ }
+
+#pragma warning disable 4014
+ AuditingStore.Received().SaveAsync(Arg.Is(x => x.EntityChanges.Count == 1 &&
+ x.EntityChanges[0].ChangeType == EntityChangeType.Created &&
+ x.EntityChanges[0].EntityTypeFullName == typeof(AppEntityWithNavigationChildManyToMany).FullName &&
+ x.EntityChanges[0].PropertyChanges.Count == 1 &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyName == nameof(AppEntityWithNavigationChildManyToMany.ChildName) &&
+ x.EntityChanges[0].PropertyChanges[0].PropertyTypeFullName == typeof(string).FullName));
+
+#pragma warning restore 4014
+ }
+}
diff --git a/latest-versions.json b/latest-versions.json
index fc41690d54..90644f1ac5 100644
--- a/latest-versions.json
+++ b/latest-versions.json
@@ -1,6 +1,6 @@
[
{
- "version": "8.0.0",
+ "version": "8.0.1",
"releaseDate": "",
"type": "stable",
"message": ""
diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Navigation/BasicThemeNavigationExtensions.cs b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Navigation/BasicThemeNavigationExtensions.cs
deleted file mode 100644
index 020709f56c..0000000000
--- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Navigation/BasicThemeNavigationExtensions.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using JetBrains.Annotations;
-using Volo.Abp.UI.Navigation;
-
-namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Navigation;
-
-public static class BasicThemeNavigationExtensions
-{
- public const string CustomDataComponentKey = "BasicTheme.CustomComponent";
-
- public static ApplicationMenuItem UseComponent(this ApplicationMenuItem applicationMenuItem, Type componentType)
- {
- return applicationMenuItem.WithCustomData(CustomDataComponentKey, componentType);
- }
-
- [CanBeNull]
- public static Type GetComponentTypeOrDefault(this ApplicationMenuItem applicationMenuItem)
- {
- if (applicationMenuItem.CustomData.TryGetValue(CustomDataComponentKey, out object componentType))
- {
- return componentType as Type;
- }
-
- return default;
- }
-}
\ No newline at end of file
diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor
index 1f469a809a..070d514cb6 100644
--- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor
+++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor
@@ -1,5 +1,4 @@
-@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Navigation;
-@using Volo.Abp.UI.Navigation
+@using Volo.Abp.UI.Navigation
@{
var elementId = MenuItem.ElementId ?? "MenuItem_" + MenuItem.Name.Replace(".", "_");
var cssClass = string.IsNullOrEmpty(MenuItem.CssClass) ? string.Empty : MenuItem.CssClass;
diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor
index 6d9ffb1fea..2a93e5459e 100644
--- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor
+++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor
@@ -1,5 +1,4 @@
-@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Navigation;
-@using Volo.Abp.UI.Navigation
+@using Volo.Abp.UI.Navigation
@{
var elementId = MenuItem.ElementId ?? "MenuItem_" + MenuItem.Name.Replace(".", "_");
var cssClass = string.IsNullOrEmpty(MenuItem.CssClass) ? string.Empty : MenuItem.CssClass;
diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml
index f146878b0f..19471fecfd 100644
--- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml
+++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml
@@ -6,9 +6,15 @@
var cssClass = string.IsNullOrEmpty(menuItem.CssClass) ? string.Empty : menuItem.CssClass;
var disabled = menuItem.IsDisabled ? "disabled" : string.Empty;
var url = string.IsNullOrEmpty(menuItem.Url) ? "#" : Url.IsLocalUrl(menuItem.Url) ? Url.Content(menuItem.Url.EnsureStartsWith('~')) : menuItem.Url;
+ var customComponentType = menuItem.GetComponentTypeOrDefault();
+
if (menuItem.IsLeaf)
{
- if (menuItem.Url != null)
+ if (customComponentType != null)
+ {
+ @(await Component.InvokeAsync(customComponentType))
+ }
+ else if (menuItem.Url != null)
{
@@ -28,19 +34,26 @@
{
-
-
- @foreach (var childMenuItem in menuItem.Items)
- {
- @await Html.PartialAsync("~/Themes/Basic/Components/Menu/_MenuItem.cshtml", childMenuItem)
- }
-
+ @if (customComponentType != null)
+ {
+ @(await Component.InvokeAsync(customComponentType))
+ }
+ else
+ {
+
+
+ @foreach (var childMenuItem in menuItem.Items)
+ {
+ @await Html.PartialAsync("~/Themes/Basic/Components/Menu/_MenuItem.cshtml", childMenuItem)
+ }
+
+ }
}
diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml
index 2dc72b8e58..1b5a4badbb 100644
--- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml
+++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml
@@ -5,10 +5,16 @@
var cssClass = string.IsNullOrEmpty(Model.CssClass) ? string.Empty : Model.CssClass;
var disabled = Model.IsDisabled ? "disabled" : string.Empty;
var url = string.IsNullOrEmpty(Model.Url) ? "#" : Url.IsLocalUrl(Model.Url) ? Url.Content(Model.Url.EnsureStartsWith('~')) : Model.Url;
+ var customComponentType = Model.GetComponentTypeOrDefault();
+
}
@if (Model.IsLeaf)
{
- if (Model.Url != null)
+ if (customComponentType != null)
+ {
+ @(await Component.InvokeAsync(customComponentType))
+ }
+ else if (Model.Url != null)
{
@if (Model.Icon != null)
@@ -25,20 +31,27 @@
else
{
}
diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.Designer.cs
deleted file mode 100644
index e36098e684..0000000000
--- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.Designer.cs
+++ /dev/null
@@ -1,2352 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Volo.Abp.EntityFrameworkCore;
-using Volo.CmsKit.EntityFrameworkCore;
-
-#nullable disable
-
-namespace Volo.CmsKit.Migrations
-{
- [DbContext(typeof(UnifiedDbContext))]
- [Migration("20230504122708_Initial")]
- partial class Initial
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
- .HasAnnotation("ProductVersion", "7.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ApplicationName")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)")
- .HasColumnName("ApplicationName");
-
- b.Property("BrowserInfo")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)")
- .HasColumnName("BrowserInfo");
-
- b.Property("ClientId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("ClientId");
-
- b.Property("ClientIpAddress")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("ClientIpAddress");
-
- b.Property("ClientName")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("ClientName");
-
- b.Property("Comments")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("Comments");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("CorrelationId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("CorrelationId");
-
- b.Property("Exceptions")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ExecutionDuration")
- .HasColumnType("int")
- .HasColumnName("ExecutionDuration");
-
- b.Property("ExecutionTime")
- .HasColumnType("datetime2");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("HttpMethod")
- .HasMaxLength(16)
- .HasColumnType("nvarchar(16)")
- .HasColumnName("HttpMethod");
-
- b.Property("HttpStatusCode")
- .HasColumnType("int")
- .HasColumnName("HttpStatusCode");
-
- b.Property("ImpersonatorTenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("ImpersonatorTenantId");
-
- b.Property("ImpersonatorTenantName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("ImpersonatorTenantName");
-
- b.Property("ImpersonatorUserId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("ImpersonatorUserId");
-
- b.Property("ImpersonatorUserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("ImpersonatorUserName");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("TenantName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("TenantName");
-
- b.Property("Url")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("Url");
-
- b.Property("UserId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("UserId");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("UserName");
-
- b.HasKey("Id");
-
- b.HasIndex("TenantId", "ExecutionTime");
-
- b.HasIndex("TenantId", "UserId", "ExecutionTime");
-
- b.ToTable("AbpAuditLogs", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AuditLogId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("AuditLogId");
-
- b.Property("ExecutionDuration")
- .HasColumnType("int")
- .HasColumnName("ExecutionDuration");
-
- b.Property("ExecutionTime")
- .HasColumnType("datetime2")
- .HasColumnName("ExecutionTime");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("MethodName")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("MethodName");
-
- b.Property("Parameters")
- .HasMaxLength(2000)
- .HasColumnType("nvarchar(2000)")
- .HasColumnName("Parameters");
-
- b.Property("ServiceName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("ServiceName");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("AuditLogId");
-
- b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
-
- b.ToTable("AbpAuditLogActions", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AuditLogId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("AuditLogId");
-
- b.Property("ChangeTime")
- .HasColumnType("datetime2")
- .HasColumnName("ChangeTime");
-
- b.Property("ChangeType")
- .HasColumnType("tinyint")
- .HasColumnName("ChangeType");
-
- b.Property("EntityId")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("EntityId");
-
- b.Property("EntityTenantId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("EntityTypeFullName")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("EntityTypeFullName");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("AuditLogId");
-
- b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
-
- b.ToTable("AbpEntityChanges", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("EntityChangeId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("NewValue")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)")
- .HasColumnName("NewValue");
-
- b.Property("OriginalValue")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)")
- .HasColumnName("OriginalValue");
-
- b.Property("PropertyName")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)")
- .HasColumnName("PropertyName");
-
- b.Property("PropertyTypeFullName")
- .IsRequired()
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("PropertyTypeFullName");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("EntityChangeId");
-
- b.ToTable("AbpEntityPropertyChanges", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("ContainerId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("Content")
- .HasMaxLength(2147483647)
- .HasColumnType("varbinary(max)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("ContainerId");
-
- b.HasIndex("TenantId", "ContainerId", "Name");
-
- b.ToTable("AbpBlobs", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("TenantId", "Name");
-
- b.ToTable("AbpBlobContainers", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AllowedProviders")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("DefaultValue")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("Description")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("DisplayName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("GroupName")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("IsAvailableToHost")
- .HasColumnType("bit");
-
- b.Property("IsVisibleToClients")
- .HasColumnType("bit");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ParentName")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ValueType")
- .HasMaxLength(2048)
- .HasColumnType("nvarchar(2048)");
-
- b.HasKey("Id");
-
- b.HasIndex("GroupName");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("AbpFeatures", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("DisplayName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("AbpFeatureGroups", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ProviderKey")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("ProviderName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.HasKey("Id");
-
- b.HasIndex("Name", "ProviderName", "ProviderKey")
- .IsUnique()
- .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL");
-
- b.ToTable("AbpFeatureValues", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("Description")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("IsStatic")
- .HasColumnType("bit");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("Regex")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)");
-
- b.Property("RegexDescription")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("Required")
- .HasColumnType("bit");
-
- b.Property("ValueType")
- .HasColumnType("int");
-
- b.HasKey("Id");
-
- b.ToTable("AbpClaimTypes", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("SourceTenantId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("SourceUserId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("TargetTenantId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("TargetUserId")
- .HasColumnType("uniqueidentifier");
-
- b.HasKey("Id");
-
- b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId")
- .IsUnique()
- .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL");
-
- b.ToTable("AbpLinkUsers", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("EntityVersion")
- .HasColumnType("int");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("IsDefault")
- .HasColumnType("bit")
- .HasColumnName("IsDefault");
-
- b.Property("IsPublic")
- .HasColumnType("bit")
- .HasColumnName("IsPublic");
-
- b.Property("IsStatic")
- .HasColumnType("bit")
- .HasColumnName("IsStatic");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName");
-
- b.ToTable("AbpRoles", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .HasColumnType("uniqueidentifier");
-
- b.Property("ClaimType")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ClaimValue")
- .HasMaxLength(1024)
- .HasColumnType("nvarchar(1024)");
-
- b.Property("RoleId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AbpRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("Action")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)");
-
- b.Property("ApplicationName")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)");
-
- b.Property("BrowserInfo")
- .HasMaxLength(512)
- .HasColumnType("nvarchar(512)");
-
- b.Property("ClientId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("ClientIpAddress")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("CorrelationId")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("Identity")
- .HasMaxLength(96)
- .HasColumnType("nvarchar(96)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("TenantName")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("UserId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("TenantId", "Action");
-
- b.HasIndex("TenantId", "ApplicationName");
-
- b.HasIndex("TenantId", "Identity");
-
- b.HasIndex("TenantId", "UserId");
-
- b.ToTable("AbpSecurityLogs", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("AccessFailedCount")
- .ValueGeneratedOnAdd()
- .HasColumnType("int")
- .HasDefaultValue(0)
- .HasColumnName("AccessFailedCount");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasMaxLength(40)
- .HasColumnType("nvarchar(40)")
- .HasColumnName("ConcurrencyStamp");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2")
- .HasColumnName("CreationTime");
-
- b.Property("CreatorId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("CreatorId");
-
- b.Property("DeleterId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("DeleterId");
-
- b.Property("DeletionTime")
- .HasColumnType("datetime2")
- .HasColumnName("DeletionTime");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("Email");
-
- b.Property("EmailConfirmed")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("EmailConfirmed");
-
- b.Property("EntityVersion")
- .HasColumnType("int");
-
- b.Property("ExtraProperties")
- .HasColumnType("nvarchar(max)")
- .HasColumnName("ExtraProperties");
-
- b.Property("IsActive")
- .HasColumnType("bit")
- .HasColumnName("IsActive");
-
- b.Property("IsDeleted")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("IsDeleted");
-
- b.Property("IsExternal")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("IsExternal");
-
- b.Property("LastModificationTime")
- .HasColumnType("datetime2")
- .HasColumnName("LastModificationTime");
-
- b.Property("LastModifierId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("LastModifierId");
-
- b.Property("LastPasswordChangeTime")
- .HasColumnType("datetimeoffset");
-
- b.Property("LockoutEnabled")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("LockoutEnabled");
-
- b.Property("LockoutEnd")
- .HasColumnType("datetimeoffset");
-
- b.Property("Name")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("Name");
-
- b.Property("NormalizedEmail")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("NormalizedEmail");
-
- b.Property("NormalizedUserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("NormalizedUserName");
-
- b.Property("PasswordHash")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("PasswordHash");
-
- b.Property("PhoneNumber")
- .HasMaxLength(16)
- .HasColumnType("nvarchar(16)")
- .HasColumnName("PhoneNumber");
-
- b.Property("PhoneNumberConfirmed")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("PhoneNumberConfirmed");
-
- b.Property("SecurityStamp")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("SecurityStamp");
-
- b.Property("ShouldChangePasswordOnNextLogin")
- .HasColumnType("bit");
-
- b.Property("Surname")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)")
- .HasColumnName("Surname");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("TwoFactorEnabled")
- .ValueGeneratedOnAdd()
- .HasColumnType("bit")
- .HasDefaultValue(false)
- .HasColumnName("TwoFactorEnabled");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)")
- .HasColumnName("UserName");
-
- b.HasKey("Id");
-
- b.HasIndex("Email");
-
- b.HasIndex("NormalizedEmail");
-
- b.HasIndex("NormalizedUserName");
-
- b.HasIndex("UserName");
-
- b.ToTable("AbpUsers", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .HasColumnType("uniqueidentifier");
-
- b.Property("ClaimType")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("ClaimValue")
- .HasMaxLength(1024)
- .HasColumnType("nvarchar(1024)");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.Property("UserId")
- .HasColumnType("uniqueidentifier");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AbpUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uniqueidentifier");
-
- b.Property("EndTime")
- .HasColumnType("datetime2");
-
- b.Property("SourceUserId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("StartTime")
- .HasColumnType("datetime2");
-
- b.Property("TargetUserId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("TenantId")
- .HasColumnType("uniqueidentifier")
- .HasColumnName("TenantId");
-
- b.HasKey("Id");
-
- b.ToTable("AbpUserDelegations", (string)null);
- });
-
- modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
- {
- b.Property("UserId")
- .HasColumnType("uniqueidentifier");
-
- b.Property("LoginProvider")
- .HasMaxLength(64)
- .HasColumnType("nvarchar(64)");
-
- b.Property("ProviderDisplayName")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property