diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index 63e795efee..16ce5acab0 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -419,6 +419,15 @@ "WhoWeAre_Expert": "About Me", "CreateSolutionFolder": "Create Solution Folder", "CreateSolutionFolderOption": "Specifies if the project will be in a new folder in the output folder or directly the output folder.", - "BooksPageTitle": "ABP Books" + "BooksPageTitle": "ABP Books", + "PackageDetailPage_NuGetPackageInstallationOptions": "There are two ways to install {0} NuGet package to your project", + "PackageDetailPage_InstallingWithABPCLI": "1: Installing with the ABP CLI", + "PackageDetailPage_InstallingWithABPCLIDescription1": "If you haven't installed the ABP CLI, first install by executing the following command in a command-line terminal", + "PackageDetailPage_InstallingWithABPCLIDescription2": "Once you have installed the ABP CLI, open a command-line terminal in the location of the project (.csproj file) you want to install it and execute the following command", + "PackageDetailPage_InstallingWithABPCLIDescription3": "It will add the {0} package reference to your project and the {1} dependency to your module class.", + "PackageDetailPage_ManualInstallation": "2: Manual Installation", + "PackageDetailPage_ManualInstallationDesription1": "Add {0} NuGet package reference to your project using your IDE or executing the following command", + "PackageDetailPage_ManualInstallationDesription2": "Then add the {0} dependency to your module class as shown in the following example", + "PackageDetailPage_SeeDocumentation": "See the documentation to learn how to use this package in your applications." } } diff --git a/docs/en/Tutorials/Part-8.md b/docs/en/Tutorials/Part-8.md index 24dafffdb9..9d638e909e 100644 --- a/docs/en/Tutorials/Part-8.md +++ b/docs/en/Tutorials/Part-8.md @@ -102,7 +102,7 @@ namespace Acme.BookStore.Authors; public class GetAuthorListDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } ```` diff --git a/docs/en/UI/Angular/Theme-Configurations.md b/docs/en/UI/Angular/Theme-Configurations.md index e663955667..09cbc5914c 100644 --- a/docs/en/UI/Angular/Theme-Configurations.md +++ b/docs/en/UI/Angular/Theme-Configurations.md @@ -69,7 +69,7 @@ Theme packages no longer import styles as CSS modules as of ABP version 6.0. The }, ``` -## Lepton X +## Lepton X [commercial](https://docs.abp.io/en/commercial) ```json { "input": "node_modules/@volosoft/ngx-lepton-x/assets/css/dark.css", @@ -174,7 +174,7 @@ Theme packages no longer import styles as CSS modules as of ABP version 6.0. The ``` -## Theme Lepton +## Theme Lepton [commercial](https://docs.abp.io/en/commercial) ```json { "input": "node_modules/@volo/abp.ng.theme.lepton/dist/global/styles/lepton1.min.css", diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 4f33f30f51..ad2bbc652b 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -16,7 +16,7 @@ }, { "text": "Getting Started", - "path":"Getting-Started-Overall.md", + "path": "Getting-Started-Overall.md", "items": [ { "text": "Web Application - Layered Architecture", @@ -1166,6 +1166,10 @@ "text": "Overall", "path": "UI/Angular/Theming.md" }, + { + "text": "Configuration", + "path": "UI/Angular/Theme-Configurations.md" + }, { "text": "The Basic Theme", "path": "UI/Angular/Basic-Theme.md" @@ -1405,8 +1409,8 @@ "path": "Modules/IdentityServer.md", "items": [ { - "text": "IdentityServer Migration Guide", - "path": "Migration-Guides/IdentityServer4-Step-by-Step.md" + "text": "IdentityServer Migration Guide", + "path": "Migration-Guides/IdentityServer4-Step-by-Step.md" } ] }, @@ -1438,7 +1442,7 @@ }, { "text": "Common", - "items":[ + "items": [ { "text": "Database Tables", "path": "Modules/Database-Tables.md" @@ -1515,4 +1519,4 @@ "path": "Contribution/Index.md" } ] -} \ No newline at end of file +} diff --git a/docs/zh-Hans/Tutorials/Part-8.md b/docs/zh-Hans/Tutorials/Part-8.md index d3b78de7e0..5c58d1b524 100644 --- a/docs/zh-Hans/Tutorials/Part-8.md +++ b/docs/zh-Hans/Tutorials/Part-8.md @@ -107,7 +107,7 @@ namespace Acme.BookStore.Authors { public class GetAuthorListDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } } ```` diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index f98d2dd1a5..1c201237e3 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -437,6 +437,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Compone EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap.Abstractions", "src\Volo.Abp.Ldap.Abstractions\Volo.Abp.Ldap.Abstractions.csproj", "{0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Ddd.Domain.Shared", "src\Volo.Abp.Ddd.Domain.Shared\Volo.Abp.Ddd.Domain.Shared.csproj", "{0858571B-CE73-4AD6-BD06-EC9F0714D8E9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1303,6 +1305,10 @@ Global {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}.Debug|Any CPU.Build.0 = Debug|Any CPU {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}.Release|Any CPU.ActiveCfg = Release|Any CPU {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}.Release|Any CPU.Build.0 = Release|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1523,6 +1529,7 @@ Global {E9492F9F-47E0-45A6-A51D-9949FEAA8543} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {8764DFAF-D13D-449A-9A5E-5D7F0B2D7FEF} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs index 3e775d0da2..3ac06350d9 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs @@ -1,14 +1,23 @@ using System; using System.Globalization; using System.Net; +using System.Runtime.ExceptionServices; +using System.Text; using System.Text.Encodings.Web; +using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; +using Microsoft.AspNetCore.Http.Json; +using Microsoft.AspNetCore.Internal; +using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; +using Microsoft.Net.Http.Headers; +using Volo.Abp.Http; +using Volo.Abp.Json; using Volo.Abp.MultiTenancy; namespace Volo.Abp.AspNetCore.MultiTenancy; @@ -58,14 +67,70 @@ public class AbpAspNetCoreMultiTenancyOptions } } + context.Response.Headers.Add("Abp-Tenant-Resolve-Error", HtmlEncoder.Default.Encode(exception.Message)); if (isCookieAuthentication && context.Request.Method.Equals("Get", StringComparison.OrdinalIgnoreCase) && !context.Request.IsAjax()) { - context.Response.Headers.Add("Abp-Tenant-Resolve-Error", HtmlEncoder.Default.Encode(exception.Message)); context.Response.Redirect(context.Request.GetEncodedUrl()); } + else if (context.Request.IsAjax()) + { + var error = new RemoteServiceErrorResponse(new RemoteServiceErrorInfo(exception.Message, exception is BusinessException businessException ? businessException.Details : string.Empty)); + + var jsonSerializerOptions = context.RequestServices.GetRequiredService>().Value.SerializerOptions; + + ResponseContentTypeHelper.ResolveContentTypeAndEncoding( + null, + context.Response.ContentType, + (new MediaTypeHeaderValue("application/json") + { + Encoding = Encoding.UTF8 + }.ToString(), Encoding.UTF8), + MediaType.GetEncoding, + out var resolvedContentType, + out var resolvedContentTypeEncoding); + + context.Response.ContentType = resolvedContentType; + context.Response.StatusCode = (int)HttpStatusCode.NotFound; + + var responseStream = context.Response.Body; + if (resolvedContentTypeEncoding.CodePage == Encoding.UTF8.CodePage) + { + try + { + await JsonSerializer.SerializeAsync(responseStream, error, error.GetType(), jsonSerializerOptions, context.RequestAborted); + await responseStream.FlushAsync(context.RequestAborted); + } + catch (OperationCanceledException) when (context.RequestAborted.IsCancellationRequested) { } + } + else + { + var transcodingStream = Encoding.CreateTranscodingStream(context.Response.Body, resolvedContentTypeEncoding, Encoding.UTF8, leaveOpen: true); + ExceptionDispatchInfo exceptionDispatchInfo = null; + try + { + await JsonSerializer.SerializeAsync(transcodingStream, error, error.GetType(), jsonSerializerOptions, context.RequestAborted); + await transcodingStream.FlushAsync(context.RequestAborted); + } + catch (OperationCanceledException) when (context.RequestAborted.IsCancellationRequested) { } + catch (Exception ex) + { + exceptionDispatchInfo = ExceptionDispatchInfo.Capture(ex); + } + finally + { + try + { + await transcodingStream.DisposeAsync(); + } + catch when (exceptionDispatchInfo != null) + { + } + exceptionDispatchInfo?.Throw(); + } + } + } else { - context.Response.Headers.Add("Abp-Tenant-Resolve-Error", HtmlEncoder.Default.Encode(exception.Message)); context.Response.StatusCode = (int)HttpStatusCode.NotFound; context.Response.ContentType = "text/html"; diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs new file mode 100644 index 0000000000..bff1290835 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs @@ -0,0 +1,78 @@ +using System; +using System.Net.Mime; +using System.Text; +using Microsoft.AspNetCore.Http; +using Microsoft.Net.Http.Headers; + +namespace Microsoft.AspNetCore.Internal; + +/// +/// https://github.com/dotnet/aspnetcore/blob/release/7.0/src/Shared/ResponseContentTypeHelper.cs +/// +public static class ResponseContentTypeHelper +{ + /// + /// Gets the content type and encoding that need to be used for the response. + /// The priority for selecting the content type is: + /// 1. ContentType property set on the action result + /// 2. property set on + /// 3. Default content type set on the action result + /// + /// + /// The user supplied content type is not modified and is used as is. For example, if user + /// sets the content type to be "text/plain" without any encoding, then the default content type's + /// encoding is used to write the response and the ContentType header is set to be "text/plain" without any + /// "charset" information. + /// + public static void ResolveContentTypeAndEncoding( + string? actionResultContentType, + string? httpResponseContentType, + (string defaultContentType, Encoding defaultEncoding) @default, + Func getEncoding, + out string resolvedContentType, + out Encoding resolvedContentTypeEncoding) + { + var (defaultContentType, defaultContentTypeEncoding) = @default; + + // 1. User sets the ContentType property on the action result + if (actionResultContentType != null) + { + resolvedContentType = actionResultContentType; + var actionResultEncoding = getEncoding(actionResultContentType); + resolvedContentTypeEncoding = actionResultEncoding ?? defaultContentTypeEncoding; + return; + } + + // 2. User sets the ContentType property on the http response directly + if (!string.IsNullOrEmpty(httpResponseContentType)) + { + var mediaTypeEncoding = getEncoding(httpResponseContentType); + if (mediaTypeEncoding != null) + { + resolvedContentType = httpResponseContentType; + resolvedContentTypeEncoding = mediaTypeEncoding; + } + else + { + resolvedContentType = httpResponseContentType; + resolvedContentTypeEncoding = defaultContentTypeEncoding; + } + + return; + } + + // 3. Fall-back to the default content type + resolvedContentType = defaultContentType; + resolvedContentTypeEncoding = defaultContentTypeEncoding; + } + + public static Encoding GetEncoding(string mediaType) + { + if (MediaTypeHeaderValue.TryParse(mediaType, out var parsed)) + { + return parsed.Encoding; + } + + return default; + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs index 83ae5a9f73..35ae34b895 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliUrls.cs @@ -29,6 +29,11 @@ public static class CliUrls return $"{NuGetRootPath}{apiKey}/v3/package/{packageId}/index.json"; } + public static string GetNuGetPackageSearchUrl(string apiKey, string packageId) + { + return $"{NuGetRootPath}{apiKey}/v3/search?q={packageId}"; + } + public static string GetApiDefinitionUrl(string url, ApplicationApiDescriptionModelRequestDto model = null) { url = url.EnsureEndsWith('/'); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs index e99eddb499..7bfb578a2d 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CommercialPackages.cs @@ -4,9 +4,9 @@ using System.Text; namespace Volo.Abp.Cli.Version; -internal static class CommercialPackages +static internal class CommercialPackages { - private static readonly HashSet Packages = new() + private readonly static HashSet Packages = new() { "volo.abp.suite" //other PRO packages can be added to this list... diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs index 43ced1a1a1..de8511cdca 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/PackageVersionCheckerService.cs @@ -109,20 +109,54 @@ public class PackageVersionCheckerService : ITransientDependency return await GetPackageVersionsFromMyGet(packageId); } - if (CommercialPackages.IsCommercial(packageId)) + if (await IsCommercialPackageAsync(packageId)) { return await GetPackageVersionsFromAbpCommercialNuGetAsync(packageId); } - else + + return await GetPackageVersionsFromNuGetOrgAsync(packageId) ?? new List(); + } + + private async Task IsCommercialPackageAsync(string packageId) + { + if (CommercialPackages.IsCommercial(packageId)) + { + return true; + } + + await SetApiKeyResultAsync(); + if (_apiKeyResult?.ApiKey == null) { - var packagesFromNugetOrg = await GetPackageVersionsFromNuGetOrgAsync(packageId); - if (packagesFromNugetOrg != null) + return false; + } + + var searchUrl = CliUrls.GetNuGetPackageSearchUrl(_apiKeyResult.ApiKey, packageId); + return await HasAnyPackageAsync(searchUrl); + } + + private async Task HasAnyPackageAsync(string url) + { + try + { + var client = _cliHttpClientFactory.CreateClient(needsAuthentication: false); + + using (var responseMessage = await client.GetHttpResponseMessageWithRetryAsync( + url, + cancellationToken: CancellationTokenProvider.Token, + logger: Logger + )) { - return packagesFromNugetOrg; + await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage); + + var responseContent = await responseMessage.Content.ReadAsStringAsync(); + + return JsonSerializer.Deserialize(responseContent).TotalHits > 0; } } - - return await GetPackageVersionsFromAbpCommercialNuGetAsync(packageId); + catch (Exception) + { + return false; + } } private async Task> GetPackageVersionsFromAbpCommercialNuGetAsync(string packageId) @@ -175,19 +209,15 @@ public class PackageVersionCheckerService : ITransientDependency private async Task GetNuGetUrlForCommercialPackage(string packageId) { - if (_apiKeyResult == null) - { - _apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync(); - - if (_apiKeyResult == null) - { - return null; - } - } - + await SetApiKeyResultAsync(); return CliUrls.GetNuGetPackageInfoUrl(_apiKeyResult.ApiKey, packageId); } + private async Task SetApiKeyResultAsync() + { + _apiKeyResult ??= await _apiKeyService.GetApiKeyOrNullAsync(); + } + private async Task GetLatestStableVersionOrNullAsync() { try @@ -214,6 +244,12 @@ public class PackageVersionCheckerService : ITransientDependency } } + public class NuGetSearchResultDto + { + [JsonProperty("totalHits")] + public int TotalHits { get; set; } + } + public class NuGetVersionResultDto { [JsonProperty("versions")] diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xml b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xml new file mode 100644 index 0000000000..bc5a74a236 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xsd b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj new file mode 100644 index 0000000000..489d2cf271 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj @@ -0,0 +1,22 @@ + + + + + + + netstandard2.0;netstandard2.1;net7.0 + Volo.Abp.Ddd.Domain.Shared + Volo.Abp.Ddd.Domain.Shared + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + + + + + + + + + diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/AbpDddDomainSharedModule.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/AbpDddDomainSharedModule.cs new file mode 100644 index 0000000000..3276f22310 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/AbpDddDomainSharedModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.EventBus.Abstractions; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; + +namespace Volo.Abp.Domain; + +[DependsOn( + typeof(AbpMultiTenancyModule), + typeof(AbpEventBusAbstractionsModule) +)] +public class AbpDddDomainSharedModule : AbpModule +{ + +} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs similarity index 91% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs index 18c56bfca7..bb9e362ac2 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Volo.Abp.EventBus.Distributed; namespace Volo.Abp.Domain.Entities.Events.Distributed; diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj b/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj index fd80a60544..c15f7c96a8 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj @@ -15,6 +15,7 @@ + diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs index 0b41fef1cf..536e31e51f 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs @@ -22,7 +22,8 @@ namespace Volo.Abp.Domain; typeof(AbpObjectMappingModule), typeof(AbpExceptionHandlingModule), typeof(AbpSpecificationsModule), - typeof(AbpCachingModule) + typeof(AbpCachingModule), + typeof(AbpDddDomainSharedModule) )] public class AbpDddDomainModule : AbpModule { diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs index 33fdadc9b4..0a5eaa851e 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -462,7 +462,7 @@ public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, protected virtual void ApplyAbpConceptsForModifiedEntity(EntityEntry entry) { - if (entry.State == EntityState.Modified && entry.Properties.Any(x => x.IsModified && x.Metadata.ValueGenerated == ValueGenerated.Never)) + if (entry.State == EntityState.Modified && entry.Properties.Any(x => x.IsModified && (x.Metadata.ValueGenerated == ValueGenerated.Never || x.Metadata.ValueGenerated == ValueGenerated.OnAdd))) { IncrementEntityVersionProperty(entry); SetModificationAuditProperties(entry); diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj b/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj index 225b9b70ee..b61d8315c1 100644 --- a/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj +++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj @@ -9,7 +9,7 @@ - + diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs index 85cddf42b8..5d19fa21ba 100644 --- a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs +++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs @@ -1,7 +1,11 @@ using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; namespace Volo.Abp.EventBus.Abstractions; +[DependsOn( + typeof(AbpObjectExtendingModule) +)] public class AbpEventBusAbstractionsModule : AbpModule { diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventInbox.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventInbox.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventInbox.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventInbox.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventOutbox.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventOutbox.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IOutboxSender.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IOutboxSender.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IOutboxSender.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IOutboxSender.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfig.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfig.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfig.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfig.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfig.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfig.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfig.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfig.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventBus.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventBus.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerFactory.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerFactory.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerFactory.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerFactory.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerInvoker.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerInvoker.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerInvoker.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerInvoker.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/ILocalEventBus.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/ILocalEventBus.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/ILocalEventBus.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/ILocalEventBus.cs diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs index 8932745f29..2d2de48992 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs @@ -1,9 +1,10 @@ -using System.Collections.Generic; -using System.Net; +using System.Net; +using System.Text.Json; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Shouldly; +using Volo.Abp.Http; using Xunit; namespace Volo.Abp.AspNetCore.MultiTenancy; @@ -23,4 +24,17 @@ public class AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests var result = await GetResponseAsStringAsync($"http://abp.io?{_options.TenantKey}=", HttpStatusCode.NotFound); result.ShouldNotContain(""); } + + [Fact] + public async Task MultiTenancyMiddlewareErrorPageBuilder_Ajax_Test() + { + using (var response = await GetResponseAsync($"http://abp.io?{_options.TenantKey}=abpio", HttpStatusCode.NotFound, xmlHttpRequest: true)) + { + var result = await response.Content.ReadAsStringAsync(); + var error = JsonSerializer.Deserialize(result, new JsonSerializerOptions {PropertyNamingPolicy = JsonNamingPolicy.CamelCase}); + error.Error.ShouldNotBeNull(); + error.Error.Message.ShouldBe("Tenant not found!"); + error.Error.Details.ShouldBe("There is no tenant with the tenant id or name: abpio"); + } + } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs index 3f6e11c02d..8ad0029cc0 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Auditing/Auditing_Tests.cs @@ -29,6 +29,28 @@ public class Auditing_Tests : Auditing_Tests })); } + [Fact] + public async Task Should_Set_Modification_If_Properties_Changed_With_Default_Value() + { + var date = DateTime.Parse("2022-01-01"); + await WithUnitOfWorkAsync((async () => + { + var douglas = await PersonRepository.GetAsync(TestDataBuilder.UserDouglasId); + douglas.HasDefaultValue = date; + })); + + await WithUnitOfWorkAsync((async () => + { + var douglas = await PersonRepository.FindAsync(TestDataBuilder.UserDouglasId); + + douglas.ShouldNotBeNull(); + douglas.HasDefaultValue.ShouldBe(date); + douglas.LastModificationTime.ShouldNotBeNull(); + douglas.LastModificationTime.Value.ShouldBeLessThanOrEqualTo(Clock.Now); + douglas.LastModifierId.ShouldBe(CurrentUserId); + })); + } + [Fact] public async Task Should_Set_Modification_If_Properties_Not_Generated_By_Database() { diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs index 529912aa68..99e689bdd4 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs @@ -20,7 +20,7 @@ public class TestMigrationsDbContext : AbpDbContext public DbSet EntityWithIntPks { get; set; } public DbSet Author { get; set; } - + public DbSet Products { get; set; } public TestMigrationsDbContext(DbContextOptions options) @@ -44,6 +44,7 @@ public class TestMigrationsDbContext : AbpDbContext modelBuilder.Entity(b => { b.Property(x => x.LastActiveTime).ValueGeneratedOnAddOrUpdate().HasDefaultValue(DateTime.Now); + b.Property(x => x.HasDefaultValue).HasDefaultValue(DateTime.Now); }); modelBuilder.Entity(b => diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs index 921b97f6a4..66772343af 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs @@ -29,7 +29,7 @@ public class TestAppDbContext : AbpDbContext, IThirdDbContext, public DbSet Author { get; set; } public DbSet FourthDummyEntities { get; set; } - + public DbSet Products { get; set; } public TestAppDbContext(DbContextOptions options) @@ -60,6 +60,7 @@ public class TestAppDbContext : AbpDbContext, IThirdDbContext, modelBuilder.Entity(b => { b.Property(x => x.LastActiveTime).ValueGeneratedOnAddOrUpdate().HasDefaultValue(DateTime.Now); + b.Property(x => x.HasDefaultValue).HasDefaultValue(DateTime.Now); }); modelBuilder diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs index 0726126eba..5d78236fca 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs @@ -30,6 +30,8 @@ public class Person : FullAuditedAggregateRoot, IMultiTenant, IHasEntityVe public virtual DateTime LastActiveTime { get; set; } + public virtual DateTime HasDefaultValue { get; set; } + public int EntityVersion { get; set; } private Person() diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs deleted file mode 100644 index 62e4c309ca..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs +++ /dev/null @@ -1,2303 +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("20221216140823_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.0") - .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("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("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("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("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.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("ProviderKey") - .IsRequired() - .HasMaxLength(196) - .HasColumnType("nvarchar(196)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("AbpUserLogins", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => - { - b.Property("OrganizationUnitId") - .HasColumnType("uniqueidentifier"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("OrganizationUnitId", "UserId"); - - b.HasIndex("UserId", "OrganizationUnitId"); - - b.ToTable("AbpUserOrganizationUnits", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("AbpUserRoles", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LoginProvider") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AbpUserTokens", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(95) - .HasColumnType("nvarchar(95)") - .HasColumnName("Code"); - - 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("DisplayName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)") - .HasColumnName("DisplayName"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("ParentId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("Code"); - - b.HasIndex("ParentId"); - - b.ToTable("AbpOrganizationUnits", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => - { - b.Property("OrganizationUnitId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("OrganizationUnitId", "RoleId"); - - b.HasIndex("RoleId", "OrganizationUnitId"); - - b.ToTable("AbpOrganizationUnitRoles", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", 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("GroupName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("IsEnabled") - .HasColumnType("bit"); - - b.Property("MultiTenancySide") - .HasColumnType("tinyint"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ParentName") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Providers") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("StateCheckers") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("GroupName"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpPermissions", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") - .IsUnique() - .HasFilter("[TenantId] IS NOT NULL"); - - b.ToTable("AbpPermissionGrants", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", 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("AbpPermissionGroups", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", 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(2048) - .HasColumnType("nvarchar(2048)"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey") - .IsUnique() - .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); - - b.ToTable("AbpSettings", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - 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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("AbpTenants", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.HasKey("TenantId", "Name"); - - b.ToTable("AbpTenantConnectionStrings", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Blogs.Blog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - 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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.ToTable("CmsBlogs", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Blogs.BlogFeature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BlogId") - .HasColumnType("uniqueidentifier"); - - 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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("FeatureName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("IsEnabled") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.HasKey("Id"); - - b.ToTable("CmsBlogFeatures", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AuthorId") - .HasColumnType("uniqueidentifier"); - - b.Property("BlogId") - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("Content") - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - b.Property("CoverImageMediaId") - .HasColumnType("uniqueidentifier"); - - 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("EntityVersion") - .HasColumnType("int"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("ShortDescription") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("AuthorId"); - - b.HasIndex("Slug", "BlogId"); - - b.ToTable("CmsBlogPosts", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Comments.Comment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - 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("EntityId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("RepliedCommentId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("nvarchar(512)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "RepliedCommentId"); - - b.HasIndex("TenantId", "EntityType", "EntityId"); - - b.ToTable("CmsComments", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.GlobalResources.GlobalResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - 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("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("CmsGlobalResources", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.MediaDescriptors.MediaDescriptor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - 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("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("MimeType") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("Size") - .HasMaxLength(2147483647) - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.ToTable("CmsMediaDescriptors", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Menus.MenuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - 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("CssClass") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ElementId") - .HasColumnType("nvarchar(max)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("Icon") - .HasColumnType("nvarchar(max)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ParentId") - .HasColumnType("uniqueidentifier"); - - b.Property("Target") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("nvarchar(1024)"); - - b.HasKey("Id"); - - b.ToTable("CmsMenuItems", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Pages.Page", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("Content") - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - 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("EntityVersion") - .HasColumnType("int"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("IsHomePage") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Script") - .HasColumnType("nvarchar(max)"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Style") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Slug"); - - b.ToTable("CmsPages", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Ratings.Rating", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("EntityId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("StarCount") - .HasColumnType("smallint"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId", "CreatorId"); - - b.ToTable("CmsRatings", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Reactions.UserReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("EntityId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ReactionName") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("nvarchar(32)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId", "ReactionName"); - - b.HasIndex("TenantId", "CreatorId", "EntityType", "EntityId", "ReactionName"); - - b.ToTable("CmsUserReactions", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Tags.EntityTag", b => - { - b.Property("EntityId") - .HasColumnType("nvarchar(450)"); - - b.Property("TagId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("EntityId", "TagId"); - - b.HasIndex("TenantId", "EntityId", "TagId"); - - b.ToTable("CmsEntityTags", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Tags.Tag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - 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("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("nvarchar(32)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Name"); - - b.ToTable("CmsTags", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Users.CmsUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)") - .HasColumnName("Email"); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("EmailConfirmed"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("IsActive") - .HasColumnType("bit") - .HasColumnName("IsActive"); - - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)") - .HasColumnName("Name"); - - b.Property("PhoneNumber") - .HasMaxLength(16) - .HasColumnType("nvarchar(16)") - .HasColumnName("PhoneNumber"); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("PhoneNumberConfirmed"); - - b.Property("Surname") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)") - .HasColumnName("Surname"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("UserName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)") - .HasColumnName("UserName"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Email"); - - b.HasIndex("TenantId", "UserName"); - - b.ToTable("CmsUsers", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) - .WithMany("Actions") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) - .WithMany("PropertyChanges") - .HasForeignKey("EntityChangeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => - { - b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null) - .WithMany() - .HasForeignKey("ContainerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => - { - b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) - .WithMany() - .HasForeignKey("OrganizationUnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("OrganizationUnits") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => - { - b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) - .WithMany() - .HasForeignKey("ParentId"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => - { - b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) - .WithMany("Roles") - .HasForeignKey("OrganizationUnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.TenantManagement.Tenant", null) - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => - { - b.HasOne("Volo.CmsKit.Users.CmsUser", "Author") - .WithMany() - .HasForeignKey("AuthorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Author"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => - { - b.Navigation("Actions"); - - b.Navigation("EntityChanges"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.Navigation("PropertyChanges"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Navigation("Claims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Navigation("Claims"); - - b.Navigation("Logins"); - - b.Navigation("OrganizationUnits"); - - b.Navigation("Roles"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => - { - b.Navigation("ConnectionStrings"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221223083811_Added_EntityVersion.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221223083811_Added_EntityVersion.cs deleted file mode 100644 index f7551040f9..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221223083811_Added_EntityVersion.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Volo.CmsKit.Migrations -{ - /// - public partial class AddedEntityVersion : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "EntityVersion", - table: "AbpUsers", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EntityVersion", - table: "AbpTenants", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EntityVersion", - table: "AbpRoles", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EntityVersion", - table: "AbpOrganizationUnits", - type: "int", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EntityVersion", - table: "AbpUsers"); - - migrationBuilder.DropColumn( - name: "EntityVersion", - table: "AbpTenants"); - - migrationBuilder.DropColumn( - name: "EntityVersion", - table: "AbpRoles"); - - migrationBuilder.DropColumn( - name: "EntityVersion", - table: "AbpOrganizationUnits"); - } - } -} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221223083811_Added_EntityVersion.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.Designer.cs similarity index 98% rename from modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221223083811_Added_EntityVersion.Designer.cs rename to modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.Designer.cs index 7d96ae22d5..e36098e684 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221223083811_Added_EntityVersion.Designer.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.Designer.cs @@ -13,8 +13,8 @@ using Volo.CmsKit.EntityFrameworkCore; namespace Volo.CmsKit.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20221223083811_Added_EntityVersion")] - partial class AddedEntityVersion + [Migration("20230504122708_Initial")] + partial class Initial { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -790,6 +790,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("LastPasswordChangeTime") + .HasColumnType("datetimeoffset"); + b.Property("LockoutEnabled") .ValueGeneratedOnAdd() .HasColumnType("bit") @@ -838,6 +841,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("nvarchar(256)") .HasColumnName("SecurityStamp"); + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("bit"); + b.Property("Surname") .HasMaxLength(64) .HasColumnType("nvarchar(64)") @@ -900,6 +906,33 @@ namespace Volo.CmsKit.Migrations 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") @@ -1597,6 +1630,10 @@ namespace Volo.CmsKit.Migrations .HasMaxLength(512) .HasColumnType("nvarchar(512)"); + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + b.HasKey("Id"); b.HasIndex("TenantId", "RepliedCommentId"); diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.cs similarity index 97% rename from modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.cs rename to modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.cs index 93182aafe3..052650df63 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504122708_Initial.cs @@ -155,6 +155,7 @@ namespace Volo.CmsKit.Migrations ParentId = table.Column(type: "uniqueidentifier", nullable: true), Code = table.Column(type: "nvarchar(95)", maxLength: 95, nullable: false), DisplayName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + EntityVersion = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -235,6 +236,7 @@ namespace Volo.CmsKit.Migrations IsDefault = table.Column(type: "bit", nullable: false), IsStatic = table.Column(type: "bit", nullable: false), IsPublic = table.Column(type: "bit", nullable: false), + EntityVersion = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) }, @@ -289,6 +291,7 @@ namespace Volo.CmsKit.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + EntityVersion = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -304,6 +307,22 @@ namespace Volo.CmsKit.Migrations table.PrimaryKey("PK_AbpTenants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpUserDelegations", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + SourceUserId = table.Column(type: "uniqueidentifier", nullable: false), + TargetUserId = table.Column(type: "uniqueidentifier", nullable: false), + StartTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(type: "datetime2", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpUsers", columns: table => new @@ -327,6 +346,9 @@ namespace Volo.CmsKit.Migrations LockoutEnd = table.Column(type: "datetimeoffset", nullable: true), LockoutEnabled = table.Column(type: "bit", nullable: false, defaultValue: false), AccessFailedCount = table.Column(type: "int", nullable: false, defaultValue: 0), + ShouldChangePasswordOnNextLogin = table.Column(type: "bit", nullable: false), + EntityVersion = table.Column(type: "int", nullable: false), + LastPasswordChangeTime = table.Column(type: "datetimeoffset", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -400,6 +422,7 @@ namespace Volo.CmsKit.Migrations RepliedCommentId = table.Column(type: "uniqueidentifier", nullable: true), CreatorId = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), + Url = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) }, @@ -1232,6 +1255,9 @@ namespace Volo.CmsKit.Migrations migrationBuilder.DropTable( name: "AbpUserClaims"); + migrationBuilder.DropTable( + name: "AbpUserDelegations"); + migrationBuilder.DropTable( name: "AbpUserLogins"); diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs index de8c26aa0e..b94883ec0b 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs @@ -787,6 +787,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("LastPasswordChangeTime") + .HasColumnType("datetimeoffset"); + b.Property("LockoutEnabled") .ValueGeneratedOnAdd() .HasColumnType("bit") @@ -835,6 +838,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("nvarchar(256)") .HasColumnName("SecurityStamp"); + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("bit"); + b.Property("Surname") .HasMaxLength(64) .HasColumnType("nvarchar(64)") @@ -897,6 +903,33 @@ namespace Volo.CmsKit.Migrations 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") @@ -1594,6 +1627,10 @@ namespace Volo.CmsKit.Migrations .HasMaxLength(512) .HasColumnType("nvarchar(512)"); + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + b.HasKey("Id"); b.HasIndex("TenantId", "RepliedCommentId"); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentWithAuthorDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentWithAuthorDto.cs index ab833cfb3b..d0ed17977d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentWithAuthorDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentWithAuthorDto.cs @@ -20,4 +20,6 @@ public class CommentWithAuthorDto public DateTime CreationTime { get; set; } public CmsUserDto Author { get; set; } + + public string Url { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.css b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.css index d1dbb49a6f..ba831f9356 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.css +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.css @@ -1,3 +1,3 @@ .datatableCell{ cursor: pointer; -} \ No newline at end of file +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js index 728a204f4c..e9180736dd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js @@ -114,6 +114,16 @@ $(function (){ return ""; } }, + { + title: l("URL"), + data: "url", + render: function (data, type, row) { + if (data !== null) { + return ''; + } + return ""; + } + }, { title: l("Text"), data: "text", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentConsts.cs index c878b1cdb6..aa253c9593 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentConsts.cs @@ -10,4 +10,6 @@ public static class CommentConsts public static int MaxEntityIdLength { get; set; } = CmsEntityConsts.MaxEntityIdLength; public static int MaxTextLength { get; set; } = 512; + + public static int MaxUrlLength { get; set; } = 512; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 2f7d8ce13d..5f00dd68b8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -217,6 +217,7 @@ "CommentTextRequired": "Comment is required", "CaptchaCodeErrorMessage" : "The answer you entered for the CAPTCHA was not correct. Please try again", "CaptchaCodeMissingMessage": "The captcha code is missing!", - "UnAllowedExternalUrlMessage": "You included an unallowed external URL. Please try again without the external URL." + "UnAllowedExternalUrlMessage": "You included an unallowed external URL. Please try again without the external URL.", + "URL": "URL" } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs index 0029cabfd0..7a620b8655 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs @@ -23,6 +23,8 @@ public class Comment : AggregateRoot, IHasCreationTime, IMustHaveCreator, public virtual DateTime CreationTime { get; set; } + public virtual string Url { get; set; } + protected Comment() { @@ -35,6 +37,7 @@ public class Comment : AggregateRoot, IHasCreationTime, IMustHaveCreator, [NotNull] string text, Guid? repliedCommentId, Guid creatorId, + [CanBeNull] string url = null, Guid? tenantId = null) : base(id) { @@ -42,6 +45,7 @@ public class Comment : AggregateRoot, IHasCreationTime, IMustHaveCreator, EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), CommentConsts.MaxEntityIdLength); RepliedCommentId = repliedCommentId; CreatorId = creatorId; + Url = url; TenantId = tenantId; SetTextInternal(text); diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/CommentManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/CommentManager.cs index 47ba463d99..b9f4e5c1d7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/CommentManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/CommentManager.cs @@ -21,6 +21,7 @@ public class CommentManager : DomainService [NotNull] string entityType, [NotNull] string entityId, [NotNull] string text, + [CanBeNull] string url = null, [CanBeNull] Guid? repliedCommentId = null) { Check.NotNull(creator, nameof(creator)); @@ -40,6 +41,7 @@ public class CommentManager : DomainService text, repliedCommentId, creator.Id, + url, CurrentTenant.Id); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index 9a42f6c4b0..a6a92cced4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -79,6 +79,7 @@ public static class CmsKitDbContextModelCreatingExtensions b.Property(x => x.EntityId).IsRequired().HasMaxLength(CommentConsts.MaxEntityIdLength); b.Property(x => x.Text).IsRequired().HasMaxLength(CommentConsts.MaxTextLength); b.Property(x => x.RepliedCommentId); + b.Property(x => x.Url).HasMaxLength(CommentConsts.MaxUrlLength); b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); b.HasIndex(x => new { x.TenantId, x.RepliedCommentId }); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CommentDto.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CommentDto.cs index 654a16ebdb..fe7985ff36 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CommentDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CommentDto.cs @@ -23,4 +23,6 @@ public class CommentDto : IHasConcurrencyStamp public CmsUserDto Author { get; set; } //TODO: Should only have AuthorId for the basic dto. see https://docs.abp.io/en/abp/latest/Best-Practices/Application-Services public string ConcurrencyStamp { get; set; } + + public string Url { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentInput.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentInput.cs index c0eae8650e..2399fc898d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentInput.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentInput.cs @@ -17,4 +17,6 @@ public class CreateCommentInput public Guid? CaptchaToken { get; set; } public int CaptchaAnswer { get; set; } + + public string Url { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentWithParametersInput.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentWithParametersInput.cs index bfdbd0a95d..53f993cf2b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentWithParametersInput.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CreateCommentWithParametersInput.cs @@ -23,4 +23,6 @@ public class CreateCommentWithParametersInput public Guid? CaptchaToken { get; set; } public int CaptchaAnswer { get; set; } + + public string Url { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs index 8d378ad925..c1b5e736ec 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs @@ -77,6 +77,7 @@ public class CommentPublicAppService : CmsKitPublicAppServiceBase, ICommentPubli entityType, entityId, input.Text, + input.Url, input.RepliedCommentId ) ); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml index 944a818d74..34ce468187 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml @@ -20,8 +20,8 @@ @ @((string.IsNullOrWhiteSpace(author.Name) - ? author.UserName - : author.Name + " " + author.Surname).Trim()) + ? author.UserName + : author.Name + " " + author.Surname).Trim()) @creationTime.ToString() ; } @@ -157,7 +157,7 @@ } @foreach (var comment in Model.Input.Comments) { -
+
@GetCommentTitle(comment.Author, comment.CreationTime).Invoke(null) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js index 20b7119344..c5c26672f1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js @@ -150,6 +150,7 @@ entityType: $commentArea.attr('data-entity-type'), repliedCommentId: formAsObject.repliedCommentId, text: formAsObject.commentText, + url: window.location.href, captchaToken: formAsObject.captchaId, captchaAnswer: formAsObject.input?.captcha }), @@ -178,7 +179,7 @@ $(location.hash).find('textarea').focus(); } } - + function init() { registerReplyLinks($widget); registerEditLinks($widget); diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index 7c594cf1a2..27e0d13b5f 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -43,6 +43,19 @@ }, "private": true, "devDependencies": { + "@abp/ng.account": "~7.2.1", + "@abp/ng.account.core": "~7.2.1", + "@abp/ng.core": "~7.2.1", + "@abp/ng.feature-management": "~7.2.1", + "@abp/ng.identity": "~7.2.1", + "@abp/ng.oauth": "~7.2.1", + "@abp/ng.permission-management": "~7.2.1", + "@abp/ng.schematics": "~7.2.1", + "@abp/ng.setting-management": "~7.2.1", + "@abp/ng.tenant-management": "~7.2.1", + "@abp/ng.theme.basic": "~7.2.1", + "@abp/ng.theme.lepton-x": "^2.2.0", + "@abp/ng.theme.shared": "~7.2.1", "@abp/utils": "~7.2.1", "@angular-devkit/build-angular": "~15.0.1", "@angular-devkit/schematics-cli": "~15.0.1", @@ -61,18 +74,6 @@ "@angular/platform-browser": "~15.0.1", "@angular/platform-browser-dynamic": "~15.0.1", "@angular/router": "~15.0.1", - "@abp/ng.account": "~7.2.1", - "@abp/ng.account.core": "~7.2.1", - "@abp/ng.core": "~7.2.1", - "@abp/ng.oauth": "~7.2.1", - "@abp/ng.feature-management": "~7.2.1", - "@abp/ng.identity": "~7.2.1", - "@abp/ng.permission-management": "~7.2.1", - "@abp/ng.schematics": "~7.2.1", - "@abp/ng.setting-management": "~7.2.1", - "@abp/ng.tenant-management": "~7.2.1", - "@abp/ng.theme.basic": "~7.2.1", - "@abp/ng.theme.shared": "~7.2.1", "@fortawesome/fontawesome-free": "^5.15.4", "@ng-bootstrap/ng-bootstrap": "^14.0.0", "@ngneat/spectator": "^10.0.0", @@ -93,6 +94,7 @@ "@typescript-eslint/parser": "5.44.0", "angular-oauth2-oidc": "^15.0.1", "bootstrap": "^5.1.1", + "bootstrap-icons": "^1.10.3", "chart.js": "^3.5.1", "cypress": "^7.3.0", "dotenv": "10.0.0", @@ -112,6 +114,7 @@ "ng-packagr": "15.0.1", "ng-zorro-antd": "^15.0.0", "nx": "15.2.1", + "perfect-scrollbar": "^1.5.5", "postcss": "^8.3.9", "postcss-import": "14.1.0", "postcss-preset-env": "7.5.0", @@ -126,11 +129,8 @@ "tslib": "^2.3.0", "tslint": "~6.1.0", "typescript": "4.8.4", - "zone.js": "0.11.4", - "@abp/ng.theme.lepton-x": "^2.2.0", - "bootstrap-icons": "^1.10.3" + "zone.js": "0.11.4" }, - "dependencies": {}, "lint-staged": { "**/*.{js,jsx,ts,tsx,html,css,scss}": [ "npx prettier --write --config .prettierrc " diff --git a/npm/ng-packs/packages/identity/ng-package.json b/npm/ng-packs/packages/identity/ng-package.json index a0824f39e5..68f95303e4 100644 --- a/npm/ng-packs/packages/identity/ng-package.json +++ b/npm/ng-packs/packages/identity/ng-package.json @@ -6,6 +6,7 @@ }, "allowedNonPeerDependencies": [ "@abp/ng.theme.shared", - "@abp/ng.permission-management" + "@abp/ng.permission-management", + "@abp/ng.components" ] } diff --git a/npm/ng-packs/packages/identity/package.json b/npm/ng-packs/packages/identity/package.json index 9a37fc8990..98aaf3ac3c 100644 --- a/npm/ng-packs/packages/identity/package.json +++ b/npm/ng-packs/packages/identity/package.json @@ -9,6 +9,7 @@ "dependencies": { "@abp/ng.permission-management": "~7.2.1", "@abp/ng.theme.shared": "~7.2.1", + "@abp/ng.components": "~7.2.1", "tslib": "^2.0.0" }, "publishConfig": { diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index a9594343db..bf3cf46bad 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -164,6 +164,7 @@ $projects = ( "framework/src/Volo.Abp.Ddd.Application", "framework/src/Volo.Abp.Ddd.Application.Contracts", "framework/src/Volo.Abp.Ddd.Domain", + "framework/src/Volo.Abp.Ddd.Domain.Shared", "framework/src/Volo.Abp.DistributedLocking.Abstractions", "framework/src/Volo.Abp.DistributedLocking", "framework/src/Volo.Abp.DistributedLocking.Dapr", diff --git a/templates/app/react-native/src/api/AccountAPI.js b/templates/app/react-native/src/api/AccountAPI.js index af303b626a..76a4b7f914 100644 --- a/templates/app/react-native/src/api/AccountAPI.js +++ b/templates/app/react-native/src/api/AccountAPI.js @@ -3,15 +3,34 @@ import { getEnvVars } from '../../Environment'; const { oAuthConfig } = getEnvVars(); +getLoginData = (username, password) => { + + const formData = { + grant_type: 'password', + scope: oAuthConfig.scope, + username: username, + password: password, + client_id: oAuthConfig.clientId + }; + + if (oAuthConfig.clientSecret) + formData['client_secret'] = oAuthConfig.clientSecret; + + return Object.entries(formData) + .map(([key, value]) => `${key}=${encodeURIComponent(value)}`) + .join('&'); +} + export const login = ({ username, password }) => api({ method: 'POST', url: '/connect/token', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - data: `grant_type=password&scope=${oAuthConfig.scope}&username=${username}&password=${password}&client_id=${oAuthConfig.clientId}&client_secret=${oAuthConfig.clientSecret}`, - baseURL: oAuthConfig.issuer, + data: getLoginData(username, password), + baseURL: oAuthConfig.issuer }).then(({ data }) => data); + export const Logout = () => api({ method: 'GET', diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj index 6ad1317813..2c65ca90c5 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj @@ -10,6 +10,7 @@ + diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs index 26e8c12d42..5c0c1cae56 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs @@ -1,6 +1,7 @@ using Volo.Abp.Modularity; using Volo.Abp.Localization; using MyCompanyName.MyProjectName.Localization; +using Volo.Abp.Domain; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Validation; using Volo.Abp.Validation.Localization; @@ -9,7 +10,8 @@ using Volo.Abp.VirtualFileSystem; namespace MyCompanyName.MyProjectName; [DependsOn( - typeof(AbpValidationModule) + typeof(AbpValidationModule), + typeof(AbpDddDomainSharedModule) )] public class MyProjectNameDomainSharedModule : AbpModule {