diff --git a/docs/en/CLI.md b/docs/en/CLI.md index fc76aa997b..d4a33a2a12 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -31,6 +31,7 @@ Here, the list of all available commands before explaining their details: * **`update`**: Automatically updates all ABP related NuGet and NPM packages in a solution. * **`add-package`**: Adds an ABP package to a project. * **`add-module`**: Adds a [multi-package application module](https://docs.abp.io/en/abp/latest/Modules/Index) to a solution. +* **`list-modules`**: Lists names of open-source application modules. * **`get-source`**: Downloads the source code of a module. * **`generate-proxy`**: Generates client side proxies to use HTTP API endpoints. * **`remove-proxy`**: Removes previously generated client side proxies. @@ -202,6 +203,26 @@ abp add-module ProductManagement --new --add-to-solution-file * `--with-source-code`: Downloads the source code of the module to your solution folder and uses local project references instead of NuGet/NPM packages. This options is always `True` if `--new` is used. * `--add-to-solution-file`: Adds the downloaded/created module to your solution file, so you will also see the projects of the module when you open the solution on a IDE. (only available when `--with-source-code` is `True`.) +### list-modules + +Lists names of open-source application modules. + +Usage + +````bash +abp list-modules [options] +```` + +Example: + +```bash +abp list-modules +``` + +#### Options + +* `--include-pro-modules`: Includes commercial (pro) modules in the output. + ### get-source Downloads the source code of a module to your computer. diff --git a/docs/en/Tutorials/Part-2.md b/docs/en/Tutorials/Part-2.md index 7bc42b1fc9..627b55a476 100644 --- a/docs/en/Tutorials/Part-2.md +++ b/docs/en/Tutorials/Part-2.md @@ -103,7 +103,7 @@ Before starting to the UI development, we first want to prepare the localization Localization texts are located under the `Localization/BookStore` folder of the `Acme.BookStore.Domain.Shared` project: -![bookstore-localization-files](./images/bookstore-localization-files-v2.png) +![bookstore-localization-files](images/bookstore-localization-files-v2.png) Open the `en.json` (*the English translations*) file and change the content as below: @@ -157,7 +157,7 @@ It's time to create something visible and usable! Instead of classic MVC, we wil Create `Books` folder under the `Pages` folder of the `Acme.BookStore.Web` project. Add a new Razor Page by right clicking the Books folder then selecting **Add > Razor Page** menu item. Name it as `Index`: -![bookstore-add-index-page](./images/bookstore-add-index-page-v2.png) +![bookstore-add-index-page](images/bookstore-add-index-page-v2.png) Open the `Index.cshtml` and change the whole content as shown below: @@ -208,7 +208,7 @@ context.Menu.AddItem( Run the project, login to the application with the username `admin` and the password `1q2w3E*` and see the new menu item has been added to the main menu: -![bookstore-menu-items](./images/bookstore-new-menu-item.png) +![bookstore-menu-items](images/bookstore-new-menu-item.png) When you click to the Books menu item under the Book Store parent, you are being redirected to the new empty Books Page. @@ -250,7 +250,7 @@ Change the `Pages/Books/Index.cshtml` as following: Create an `Index.js` file under the `Pages/Books` folder: -![bookstore-index-js-file](./images/bookstore-index-js-file-v3.png) +![bookstore-index-js-file](images/bookstore-index-js-file-v3.png) The content of the file is shown below: @@ -344,8 +344,6 @@ It's time to create something visible and usable! There are some tools that we w - [Ng Bootstrap](https://ng-bootstrap.github.io/#/home) will be used as the UI component library. - [Ngx-Datatable](https://swimlane.gitbook.io/ngx-datatable/) will be used as the datatable library. -### BookModule - Run the following command line to create a new module, named `BookModule` in the root folder of the angular application: ```bash @@ -457,7 +455,7 @@ abp generate-proxy This command will create the following files under the `/src/app/proxy/books` folder: -![Generated files](./images/generated-proxies-3.png) +![Generated files](images/generated-proxies-3.png) ### BookComponent @@ -490,7 +488,7 @@ export class BookComponent implements OnInit { ``` * We imported and injected the generated `BookService`. -* We are using the [ListService](https://docs.abp.io/en/abp/latest/UI/Angular/List-Service), a utility service of the ABP Framework which provides easy pagination, sorting and searching. +* We are using the [ListService](../UI/Angular/List-Service.md), a utility service of the ABP Framework which provides easy pagination, sorting and searching. Open the `/src/app/book/book.component.html` and replace the content as below: @@ -531,7 +529,7 @@ Open the `/src/app/book/book.component.html` and replace the content as below: Now you can see the final result on your browser: -![Book list final result](./images/bookstore-book-list.png) +![Book list final result](images/bookstore-book-list.png) {{else if UI == "Blazor"}} diff --git a/docs/en/Tutorials/Part-3.md b/docs/en/Tutorials/Part-3.md index e58857ec89..ec326ddb65 100644 --- a/docs/en/Tutorials/Part-3.md +++ b/docs/en/Tutorials/Part-3.md @@ -48,13 +48,13 @@ This part is also recorded as a video tutorial and ** Localization key names are arbitrary and no forcing rule. But we prefer the convention used above. +> Localization key names are arbitrary and there is no forcing rule. But we prefer the convention used above. ### Permission Management UI diff --git a/docs/en/Tutorials/Part-6.md b/docs/en/Tutorials/Part-6.md index 69c6574520..d5df8133b7 100644 --- a/docs/en/Tutorials/Part-6.md +++ b/docs/en/Tutorials/Part-6.md @@ -124,7 +124,7 @@ Created this class inside the `Acme.BookStore.Domain.Shared` project since we wi ## AuthorManager: The Domain Service -`Author` constructor and `ChangeName` method is `internal`, so they can be usable only in the domain layer. Create an `AuthorManager` class in the `Authors` folder (namespace) of the `Acme.BookStore.Domain` project: +`Author` constructor and `ChangeName` methods are `internal`, so they can be used only in the domain layer. Create an `AuthorManager` class in the `Authors` folder (namespace) of the `Acme.BookStore.Domain` project: ````csharp using System; @@ -186,7 +186,7 @@ namespace Acme.BookStore.Authors * `AuthorManager` forces to create an author and change name of an author in a controlled way. The application layer (will be introduced later) will use these methods. -> **DDD tip**: Do not introduce domain service methods unless they are really needed and perform some core business rules. For this case, we needed to this service to be able to force the unique name constraint. +> **DDD tip**: Do not introduce domain service methods unless they are really needed and perform some core business rules. For this case, we needed this service to be able to force the unique name constraint. Both methods checks if there is already an author with the given name and throws a special business exception, `AuthorAlreadyExistsException`, defined in the `Acme.BookStore.Domain` project (in the `Authors` folder) as shown below: @@ -226,7 +226,7 @@ This is a unique string represents the error code thrown by your application and "BookStore:00001": "There is already an author with the same name: {name}" ```` -Whenever you throw an `AuthorAlreadyExistsException`, the end use will see a this message on the UI. +Whenever you throw an `AuthorAlreadyExistsException`, the end user will see a nice error message on the UI. ## IAuthorRepository diff --git a/docs/en/UI/Angular/Component-Replacement.md b/docs/en/UI/Angular/Component-Replacement.md index 54a1869c0e..0010a30a2f 100644 --- a/docs/en/UI/Angular/Component-Replacement.md +++ b/docs/en/UI/Angular/Component-Replacement.md @@ -546,4 +546,5 @@ The final UI looks like below: ## See Also +- [How Replaceable Components Work with Extensions](./How-Replaceable-Components-Work-with-Extensions.md) - [How to Replace PermissionManagementComponent](./Permission-Management-Component-Replacement.md) diff --git a/docs/en/UI/Angular/How-Replaceable-Components-Work-with-Extensions.md b/docs/en/UI/Angular/How-Replaceable-Components-Work-with-Extensions.md new file mode 100644 index 0000000000..d942975646 --- /dev/null +++ b/docs/en/UI/Angular/How-Replaceable-Components-Work-with-Extensions.md @@ -0,0 +1,288 @@ +# How Replaceable Components Work with Extensions + +Additional UI extensibility points ([Entity action extensions](https://docs.abp.io/en/abp/latest/UI/Angular/Entity-Action-Extensions), [data table column extensions](https://docs.abp.io/en/abp/latest/UI/Angular/Data-Table-Column-Extensions), [page toolbar extensions](https://docs.abp.io/en/abp/latest/UI/Angular/Page-Toolbar-Extensions) and others) are used in ABP pages to allow to control entity actions, table columns and page toolbar of a page. If you replace a page, you need to apply some configurations to be able to work extension components in your component. Let's see how to do this by replacing the roles page. + +Create a new module called `MyRolesModule`: + +```bash +yarn ng generate module my-roles --module app +``` + +Create a new component called `MyRolesComponent`: + +```bash +yarn ng generate component my-roles/my-roles --flat --export +``` + +Open the generated `src/app/my-roles/my-roles.component.ts` file and replace its content with the following: + +```js +import { ListService, PagedAndSortedResultRequestDto } from '@abp/ng.core'; +import { + CreateRole, + DeleteRole, + eIdentityComponents, + GetRoleById, + GetRoles, + IdentityRoleDto, + IdentityState, + RolesComponent, + UpdateRole, +} from '@abp/ng.identity'; +import { ePermissionManagementComponents } from '@abp/ng.permission-management'; +import { Confirmation, ConfirmationService } from '@abp/ng.theme.shared'; +import { + EXTENSIONS_IDENTIFIER, + FormPropData, + generateFormFromProps, +} from '@abp/ng.theme.shared/extensions'; +import { Component, Injector, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { Select, Store } from '@ngxs/store'; +import { Observable } from 'rxjs'; +import { finalize, pluck } from 'rxjs/operators'; + +@Component({ + selector: 'app-my-roles', + templateUrl: './my-roles.component.html', + providers: [ + ListService, + { + provide: EXTENSIONS_IDENTIFIER, + useValue: eIdentityComponents.Roles, + }, + { provide: RolesComponent, useExisting: MyRolesComponent }, + ], +}) +export class MyRolesComponent implements OnInit { + @Select(IdentityState.getRoles) + data$: Observable; + + @Select(IdentityState.getRolesTotalCount) + totalCount$: Observable; + + form: FormGroup; + + selected: IdentityRoleDto; + + isModalVisible: boolean; + + visiblePermissions = false; + + providerKey: string; + + modalBusy = false; + + permissionManagementKey = ePermissionManagementComponents.PermissionManagement; + + onVisiblePermissionChange = event => { + this.visiblePermissions = event; + }; + + constructor( + public readonly list: ListService, + protected confirmationService: ConfirmationService, + protected store: Store, + protected injector: Injector + ) {} + + ngOnInit() { + this.hookToQuery(); + } + + buildForm() { + const data = new FormPropData(this.injector, this.selected); + this.form = generateFormFromProps(data); + } + + openModal() { + this.buildForm(); + this.isModalVisible = true; + } + + add() { + this.selected = {} as IdentityRoleDto; + this.openModal(); + } + + edit(id: string) { + this.store + .dispatch(new GetRoleById(id)) + .pipe(pluck('IdentityState', 'selectedRole')) + .subscribe(selectedRole => { + this.selected = selectedRole; + this.openModal(); + }); + } + + save() { + if (!this.form.valid) return; + this.modalBusy = true; + + this.store + .dispatch( + this.selected.id + ? new UpdateRole({ ...this.selected, ...this.form.value, id: this.selected.id }) + : new CreateRole(this.form.value) + ) + .pipe(finalize(() => (this.modalBusy = false))) + .subscribe(() => { + this.isModalVisible = false; + this.list.get(); + }); + } + + delete(id: string, name: string) { + this.confirmationService + .warn('AbpIdentity::RoleDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', { + messageLocalizationParams: [name], + }) + .subscribe((status: Confirmation.Status) => { + if (status === Confirmation.Status.confirm) { + this.store.dispatch(new DeleteRole(id)).subscribe(() => this.list.get()); + } + }); + } + + private hookToQuery() { + this.list.hookToQuery(query => this.store.dispatch(new GetRoles(query))).subscribe(); + } + + openPermissionsModal(providerKey: string) { + this.providerKey = providerKey; + setTimeout(() => { + this.visiblePermissions = true; + }, 0); + } + + sort(data) { + const { prop, dir } = data.sorts[0]; + this.list.sortKey = prop; + this.list.sortOrder = dir; + } +} +``` + +```js + { + provide: EXTENSIONS_IDENTIFIER, + useValue: eIdentityComponents.Roles, + }, + { + provide: RolesComponent, + useExisting: MyRolesComponent + } +``` + +The two providers we have defined in `MyRolesComponent` are required for the extension components to work correctly. + +* With the first provider, we defined the extension identifier for using `RolesComponent`'s extension actions in the `MyRolesComponent`. +* With the second provider, we have replaced the `RolesComponent` injection with the `MyRolesComponent`. Default extension actions of the `RolesComponent` try to get `RolesComponent` instance. However, the actions can get the `MyRolesComponent` instance after defining the second provider. + +Open the generated `src/app/my-role/my-role.component.html` file and replace its content with the following: + +```html +
+
+
+
+
My Roles
+
+
+ +
+
+
+ +
+ +
+
+ + + +

{%{{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}}%}

+
+ + +
+ +
+
+ + + + {%{{{ + 'AbpIdentity::Save' | abpLocalization + }}}%} + +
+ + + +``` + +We have added the `abp-page-toolbar`, `abp-extensible-table`, and `abp-extensible-form` extension components to template of the `MyRolesComponent`. + +You should import the required modules for the `MyRolesComponent` to `MyRolesModule`. Open the `src/my-roles/my-roles.module.ts` file and replace the content with the following: + +```js +import { UiExtensionsModule } from '@abp/ng.theme.shared/extensions'; +import { NgModule } from '@angular/core'; +import { SharedModule } from '../shared/shared.module'; +import { MyRolesComponent } from './my-roles.component'; +import { PermissionManagementModule } from '@abp/ng.permission-management'; + +@NgModule({ + declarations: [MyRolesComponent], + imports: [SharedModule, UiExtensionsModule, PermissionManagementModule], + exports: [MyRolesComponent], +}) +export class MyRolesModule {} +``` + +- `UiExtensionsModule` imported to be able to use the extension components in your component. +- `PermissionManagementModule` imported to be able to use the `abp-permission-*management` in your component. + +As the last step, it is needs to be replaced the `RolesComponent` with the `MyRolesComponent`. Open the `app.component.ts` and modify its content as shown below: + +```js +import { ReplaceableComponentsService } from '@abp/ng.core'; +import { eIdentityComponents } from '@abp/ng.identity'; +import { MyRolesComponent } from './my-roles/my-roles.component'; + +@Component(/* component metadata */) +export class AppComponent { + constructor(private replaceableComponents: ReplaceableComponentsService) { + this.replaceableComponents.add({ component: MyRolesComponent, key: eIdentityComponents.Roles }); + } +} +``` + +After the steps above, the `RolesComponent` has been successfully replaced with the `MyRolesComponent`. When you navigate to the `/identity/roles` URL, you will see the `MyRolesComponent`'s template and see the extension components working correctly. + +![my-roles-component-with-extensions](./images/my-roles-component-with-extensions.jpg) + +![my-roles-component-form-extensions](./images/my-roles-component-form-extensions.jpg) diff --git a/docs/en/UI/Angular/Multi-Tenancy.md b/docs/en/UI/Angular/Multi-Tenancy.md index 7622db6de0..cded16e7d4 100644 --- a/docs/en/UI/Angular/Multi-Tenancy.md +++ b/docs/en/UI/Angular/Multi-Tenancy.md @@ -91,10 +91,10 @@ export const environment = { > **Important Note:** The `application.baseUrl` and the `{0}` placeholder in the value of the `baseUrl` property are required to be able to get tenant from running URL. Other placeholders in API URLs are optional. -After the configuration above, if your app runs on the `mytenant1.mydomain.com`, the app will get tenant name as **mytenant1** and replace the environment object in `ConfigState` on app initialization as follows: +After the configuration above, if your app runs on the `mytenant1.mydomain.com`, the app will get tenant name as **mytenant1** and replace the environment object in `EnvironmentService` on app initialization as follows: ```js -// environment object in ConfigState +// environment object in EnvironmentService { //... diff --git a/docs/en/UI/Angular/images/my-roles-component-form-extensions.jpg b/docs/en/UI/Angular/images/my-roles-component-form-extensions.jpg new file mode 100644 index 0000000000..a686d26edc Binary files /dev/null and b/docs/en/UI/Angular/images/my-roles-component-form-extensions.jpg differ diff --git a/docs/en/UI/Angular/images/my-roles-component-with-extensions.jpg b/docs/en/UI/Angular/images/my-roles-component-with-extensions.jpg new file mode 100644 index 0000000000..1ac82c40b7 Binary files /dev/null and b/docs/en/UI/Angular/images/my-roles-component-with-extensions.jpg differ diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 7fd7762ad4..efca73a484 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -859,6 +859,27 @@ { "text": "Custom Setting Page", "path": "UI/Angular/Custom-Setting-Page.md" + }, + { + "text": "Extensions", + "items": [ + { + "text": "Entity Action Extensions", + "path": "UI/Angular/Entity-Action-Extensions.md" + }, + { + "text": "Data Table Column Extensions", + "path": "UI/Angular/Data-Table-Column-Extensions.md" + }, + { + "text": "Page Toolbar Extensions", + "path": "UI/Angular/Page-Toolbar-Extensions.md" + }, + { + "text": "Dynamic Form Extensions", + "path": "UI/Angular/Dynamic-Form-Extensions.md" + } + ] } ] } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor index 18ebfbd4ba..eebfb501a5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor @@ -1,11 +1,14 @@ @using Microsoft.AspNetCore.Components.WebAssembly.Authentication +@using Microsoft.Extensions.Localization @using Volo.Abp.Users @using Volo.Abp.MultiTenancy +@using global::Localization.Resources.AbpUi @inject ICurrentUser CurrentUser @inject ICurrentTenant CurrentTenant @inject IJSRuntime JsRuntime @inject NavigationManager Navigation @inject SignOutSessionStateManager SignOutManager +@inject IStringLocalizer UiLocalizer @@ -28,12 +31,12 @@ } } - Logout + @UiLocalizer["Logout"] -
Log in + @UiLocalizer["Login"] @code{ diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj index ad0066db55..a379c8057d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs index 135b506e69..1710fd5bd7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs @@ -84,7 +84,6 @@ namespace Volo.Abp.AspNetCore.Mvc ); var controllerModel = moduleModel.GetOrAddController( - controllerType.FullName, _options.ControllerNameGenerator(controllerType, setting), controllerType, _modelOptions.IgnoredInterfaces diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs index 6b23857233..330cbeb77a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliCoreModule.cs @@ -34,6 +34,7 @@ namespace Volo.Abp.Cli options.Commands["update"] = typeof(UpdateCommand); options.Commands["add-package"] = typeof(AddPackageCommand); options.Commands["add-module"] = typeof(AddModuleCommand); + options.Commands["list-modules"] = typeof(ListModulesCommand); options.Commands["login"] = typeof(LoginCommand); options.Commands["logout"] = typeof(LogoutCommand); options.Commands[GenerateProxyCommand.Name] = typeof(GenerateProxyCommand); @@ -45,7 +46,7 @@ namespace Volo.Abp.Cli options.Commands["translate"] = typeof(TranslateCommand); options.Commands["build"] = typeof(BuildCommand); options.Commands["bundle"] = typeof(BundleCommand); - options.Commands["create-migration-and-run-migrator"] = typeof(CreateMigrationAndRunMigrator); + options.Commands["create-migration-and-run-migrator"] = typeof(CreateMigrationAndRunMigratorCommand); }); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigrator.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigrator.cs deleted file mode 100644 index 982ef77065..0000000000 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigrator.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.Cli.Args; -using Volo.Abp.Cli.Utils; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.Cli.Commands -{ - public class CreateMigrationAndRunMigrator : IConsoleCommand, ITransientDependency - { - public virtual async Task ExecuteAsync(CommandLineArgs commandLineArgs) - { - if (commandLineArgs.Target.IsNullOrEmpty()) - { - throw new CliUsageException( - "DbMigrations folder path is missing!" - ); - } - - var dbMigratorProjectPath = GetDbMigratorProjectPath(commandLineArgs.Target); - - if (dbMigratorProjectPath == null) - { - throw new Exception("DbMigrator is not found!"); - } - - var output = CmdHelper.RunCmdAndGetOutput($"cd \"{commandLineArgs.Target}\" && dotnet ef migrations add Initial -s \"{dbMigratorProjectPath}\""); - - if (output.Contains("Done.") && output.Contains("To undo this action") && output.Contains("ef migrations remove")) // Migration added successfully - { - CmdHelper.RunCmd("cd \"" + Path.GetDirectoryName(dbMigratorProjectPath) + "\" && dotnet run"); - } - else - { - throw new Exception("Migrations failed: " + output); - } - } - - private string GetDbMigratorProjectPath(string dbMigrationsFolderPath) - { - var srcFolder = Directory.GetParent(dbMigrationsFolderPath); - - var dbMigratorFolderPath = Directory.GetDirectories(srcFolder.FullName).FirstOrDefault(d => d.EndsWith(".DbMigrator")); - - if (dbMigratorFolderPath == null) - { - return null; - } - - return Directory.GetFiles(dbMigratorFolderPath).FirstOrDefault(f => f.EndsWith(".csproj")); - } - - public string GetUsageInfo() - { - return string.Empty; - } - - public string GetShortDescription() - { - return string.Empty; - } - } -} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigratorCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigratorCommand.cs new file mode 100644 index 0000000000..68fae779ce --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigratorCommand.cs @@ -0,0 +1,98 @@ +using System; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Cli.Args; +using Volo.Abp.Cli.Utils; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.Commands +{ + public class CreateMigrationAndRunMigratorCommand : IConsoleCommand, ITransientDependency + { + public ILogger Logger { get; set; } + + public CreateMigrationAndRunMigratorCommand() + { + Logger = NullLogger.Instance; + } + + public virtual async Task ExecuteAsync(CommandLineArgs commandLineArgs) + { + if (commandLineArgs.Target.IsNullOrEmpty()) + { + throw new CliUsageException("DbMigrations folder path is missing!"); + } + + var dbMigratorProjectPath = GetDbMigratorProjectPath(commandLineArgs.Target); + if (dbMigratorProjectPath == null) + { + throw new Exception("DbMigrator is not found!"); + } + + if (!IsDotNetEfToolInstalled()) + { + InstallDotnetEfTool(); + } + + var addMigrationCmd = $"cd \"{commandLineArgs.Target}\" && " + + $"dotnet ef migrations add Initial -s \"{dbMigratorProjectPath}\""; + + var output = CmdHelper.RunCmdAndGetOutput(addMigrationCmd); + if (output.Contains("Done.") && + output.Contains("To undo this action") && + output.Contains("ef migrations remove")) + { + // Migration added successfully + CmdHelper.RunCmd("cd \"" + Path.GetDirectoryName(dbMigratorProjectPath) + "\" && dotnet run"); + await Task.CompletedTask; + } + else + { + var exceptionMsg = "Migrations failed! The following command didn't run successfully:" + + Environment.NewLine + + addMigrationCmd + + Environment.NewLine + output; + + Logger.LogError(exceptionMsg); + throw new Exception(exceptionMsg); + } + } + + private static bool IsDotNetEfToolInstalled() + { + var output = CmdHelper.RunCmdAndGetOutput("dotnet tool list -g"); + return output.Contains("dotnet-ef"); + } + + private void InstallDotnetEfTool() + { + Logger.LogInformation("Installing dotnet-ef tool..."); + CmdHelper.RunCmd("dotnet tool install --global dotnet-ef"); + Logger.LogInformation("dotnet-ef tool is installed."); + } + + private static string GetDbMigratorProjectPath(string dbMigrationsFolderPath) + { + var srcFolder = Directory.GetParent(dbMigrationsFolderPath); + var dbMigratorDirectory = Directory.GetDirectories(srcFolder.FullName) + .FirstOrDefault(d => d.EndsWith(".DbMigrator")); + + return dbMigratorDirectory == null + ? null + : Directory.GetFiles(dbMigratorDirectory).FirstOrDefault(f => f.EndsWith(".csproj")); + } + + public string GetUsageInfo() + { + return string.Empty; + } + + public string GetShortDescription() + { + return string.Empty; + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListModulesCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListModulesCommand.cs new file mode 100644 index 0000000000..ed201d77d7 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListModulesCommand.cs @@ -0,0 +1,79 @@ +using System; +using System.Linq; +using System.Text; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using System.Threading.Tasks; +using Volo.Abp.Cli.Args; +using Volo.Abp.Cli.ProjectBuilding; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.Commands +{ + public class ListModulesCommand : IConsoleCommand, ITransientDependency + { + public ModuleInfoProvider ModuleInfoProvider { get; } + public ILogger Logger { get; set; } + + + public ListModulesCommand(ModuleInfoProvider moduleInfoProvider) + { + ModuleInfoProvider = moduleInfoProvider; + Logger = NullLogger.Instance; + } + + public async Task ExecuteAsync(CommandLineArgs commandLineArgs) + { + var modules = await ModuleInfoProvider.GetModuleListAsync(); + var freeModules = modules.Where(m => !m.IsPro).ToList(); + var proModules = modules.Where(m => m.IsPro).ToList(); + + var output = new StringBuilder(Environment.NewLine); + output.AppendLine("Open Source Application Modules"); + output.AppendLine(); + + foreach (var module in freeModules) + { + output.AppendLine($"> {module.DisplayName.PadRight(50)} ({module.Name})"); + } + + if (commandLineArgs.Options.ContainsKey("include-pro-modules")) + { + output.AppendLine(); + output.AppendLine("Commercial (Pro) Application Modules"); + output.AppendLine(); + foreach (var module in proModules) + { + output.AppendLine($"> {module.DisplayName.PadRight(50)} ({module.Name})"); + } + } + + Logger.LogInformation(output.ToString()); + } + + public string GetUsageInfo() + { + var sb = new StringBuilder(); + + sb.AppendLine(""); + sb.AppendLine("'list-modules' command is used for listing open source application modules."); + sb.AppendLine(""); + sb.AppendLine("Usage:"); + sb.AppendLine(" abp list-modules"); + sb.AppendLine(" abp list-modules --include-pro-modules"); + sb.AppendLine(""); + sb.AppendLine("Options:"); + sb.AppendLine(" --include-pro-modules Includes commercial (pro) modules in the output."); + sb.AppendLine(""); + sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); + + return sb.ToString(); + } + + public string GetShortDescription() + { + return "List open source application modules"; + } + + } +} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs b/framework/src/Volo.Abp.Ddd.Domain/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs index ac66f35864..60826a14dd 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs @@ -7,32 +7,36 @@ namespace Microsoft.Extensions.DependencyInjection { public static class ServiceCollectionRepositoryExtensions { - public static IServiceCollection AddDefaultRepository(this IServiceCollection services, Type entityType, Type repositoryImplementationType) + public static IServiceCollection AddDefaultRepository( + this IServiceCollection services, + Type entityType, + Type repositoryImplementationType, + bool replaceExisting = false) { //IReadOnlyBasicRepository var readOnlyBasicRepositoryInterface = typeof(IReadOnlyBasicRepository<>).MakeGenericType(entityType); if (readOnlyBasicRepositoryInterface.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(readOnlyBasicRepositoryInterface, repositoryImplementationType); + RegisterService(services, readOnlyBasicRepositoryInterface, repositoryImplementationType, replaceExisting); //IReadOnlyRepository var readOnlyRepositoryInterface = typeof(IReadOnlyRepository<>).MakeGenericType(entityType); if (readOnlyRepositoryInterface.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(readOnlyRepositoryInterface, repositoryImplementationType); + RegisterService(services, readOnlyRepositoryInterface, repositoryImplementationType, replaceExisting); } //IBasicRepository var basicRepositoryInterface = typeof(IBasicRepository<>).MakeGenericType(entityType); if (basicRepositoryInterface.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(basicRepositoryInterface, repositoryImplementationType); + RegisterService(services, basicRepositoryInterface, repositoryImplementationType, replaceExisting); //IRepository var repositoryInterface = typeof(IRepository<>).MakeGenericType(entityType); if (repositoryInterface.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(repositoryInterface, repositoryImplementationType); + RegisterService(services, repositoryInterface, repositoryImplementationType, replaceExisting); } } } @@ -44,26 +48,26 @@ namespace Microsoft.Extensions.DependencyInjection var readOnlyBasicRepositoryInterfaceWithPk = typeof(IReadOnlyBasicRepository<,>).MakeGenericType(entityType, primaryKeyType); if (readOnlyBasicRepositoryInterfaceWithPk.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(readOnlyBasicRepositoryInterfaceWithPk, repositoryImplementationType); + RegisterService(services, readOnlyBasicRepositoryInterfaceWithPk, repositoryImplementationType, replaceExisting); //IReadOnlyRepository var readOnlyRepositoryInterfaceWithPk = typeof(IReadOnlyRepository<,>).MakeGenericType(entityType, primaryKeyType); if (readOnlyRepositoryInterfaceWithPk.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(readOnlyRepositoryInterfaceWithPk, repositoryImplementationType); + RegisterService(services, readOnlyRepositoryInterfaceWithPk, repositoryImplementationType, replaceExisting); } //IBasicRepository var basicRepositoryInterfaceWithPk = typeof(IBasicRepository<,>).MakeGenericType(entityType, primaryKeyType); if (basicRepositoryInterfaceWithPk.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(basicRepositoryInterfaceWithPk, repositoryImplementationType); + RegisterService(services, basicRepositoryInterfaceWithPk, repositoryImplementationType, replaceExisting); //IRepository var repositoryInterfaceWithPk = typeof(IRepository<,>).MakeGenericType(entityType, primaryKeyType); if (repositoryInterfaceWithPk.IsAssignableFrom(repositoryImplementationType)) { - services.TryAddTransient(repositoryInterfaceWithPk, repositoryImplementationType); + RegisterService(services, repositoryInterfaceWithPk, repositoryImplementationType, replaceExisting); } } } @@ -71,5 +75,21 @@ namespace Microsoft.Extensions.DependencyInjection return services; } + + private static void RegisterService( + IServiceCollection services, + Type serviceType, + Type implementationType, + bool replaceExisting) + { + if (replaceExisting) + { + services.Replace(ServiceDescriptor.Transient(serviceType, implementationType)); + } + else + { + services.TryAddTransient(serviceType, implementationType); + } + } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/AbpRepositoryConventionalRegistrar.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/AbpRepositoryConventionalRegistrar.cs index f11812f2ea..f7b9527aa0 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/AbpRepositoryConventionalRegistrar.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/AbpRepositoryConventionalRegistrar.cs @@ -6,6 +6,9 @@ using Volo.Abp.DependencyInjection; namespace Volo.Abp.Domain.Repositories { + /* Repositories are not injected by class by default. + * This class specializes repository registration to apply this rule. + */ public class AbpRepositoryConventionalRegistrar : DefaultConventionalRegistrar { public static bool ExposeRepositoryClasses { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs index f3b2fc388f..548a636eff 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.Domain.Repositories { foreach (var customRepository in Options.CustomRepositories) { - Options.Services.AddDefaultRepository(customRepository.Key, customRepository.Value); + Options.Services.AddDefaultRepository(customRepository.Key, customRepository.Value, replaceExisting: true); } if (Options.RegisterDefaultRepositories) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj index 7611559008..2cfa2fb199 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj +++ b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj @@ -19,7 +19,7 @@ - + diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextOracleExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextOracleExtensions.cs index 2dd3139a82..31bde60b38 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextOracleExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextOracleExtensions.cs @@ -1,26 +1,33 @@ -// using JetBrains.Annotations; -// using Microsoft.EntityFrameworkCore; -// using System; -// using Oracle.EntityFrameworkCore.Infrastructure; -// using Volo.Abp.EntityFrameworkCore.DependencyInjection; -// -// namespace Volo.Abp.EntityFrameworkCore -// { -// public static class AbpDbContextConfigurationContextOracleExtensions -// { -// public static DbContextOptionsBuilder UseOracle( -// [NotNull] this AbpDbContextConfigurationContext context, -// [CanBeNull] Action oracleOptionsAction = null) -// { -// TODO: UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); -// if (context.ExistingConnection != null) -// { -// return context.DbContextOptions.UseOracle(context.ExistingConnection, oracleOptionsAction); -// } -// else -// { -// return context.DbContextOptions.UseOracle(context.ConnectionString, oracleOptionsAction); -// } -// } -// } -// } +using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore; +using System; +using Oracle.EntityFrameworkCore.Infrastructure; +using Volo.Abp.EntityFrameworkCore.DependencyInjection; + +namespace Volo.Abp.EntityFrameworkCore +{ + public static class AbpDbContextConfigurationContextOracleExtensions + { + public static DbContextOptionsBuilder UseOracle( + [NotNull] this AbpDbContextConfigurationContext context, + [CanBeNull] Action oracleOptionsAction = null) + { + if (context.ExistingConnection != null) + { + return context.DbContextOptions.UseOracle(context.ExistingConnection, optionsBuilder => + { + optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); + oracleOptionsAction?.Invoke(optionsBuilder); + }); + } + else + { + return context.DbContextOptions.UseOracle(context.ConnectionString, optionsBuilder => + { + optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); + oracleOptionsAction?.Invoke(optionsBuilder); + }); + } + } + } +} diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsOracleExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsOracleExtensions.cs index f5f9dc7f61..f4817d5ab4 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsOracleExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsOracleExtensions.cs @@ -1,30 +1,30 @@ -// using JetBrains.Annotations; -// using System; -// using Oracle.EntityFrameworkCore.Infrastructure; -// -// namespace Volo.Abp.EntityFrameworkCore -// { -// public static class AbpDbContextOptionsOracleExtensions -// { -// public static void UseOracle( -// [NotNull] this AbpDbContextOptions options, -// [CanBeNull] Action oracleOptionsAction = null) -// { -// options.Configure(context => -// { -// context.UseOracle(oracleOptionsAction); -// }); -// } -// -// public static void UseOracle( -// [NotNull] this AbpDbContextOptions options, -// [CanBeNull] Action oracleOptionsAction = null) -// where TDbContext : AbpDbContext -// { -// options.Configure(context => -// { -// context.UseOracle(oracleOptionsAction); -// }); -// } -// } -// } +using JetBrains.Annotations; +using System; +using Oracle.EntityFrameworkCore.Infrastructure; + +namespace Volo.Abp.EntityFrameworkCore +{ + public static class AbpDbContextOptionsOracleExtensions + { + public static void UseOracle( + [NotNull] this AbpDbContextOptions options, + [CanBeNull] Action oracleOptionsAction = null) + { + options.Configure(context => + { + context.UseOracle(oracleOptionsAction); + }); + } + + public static void UseOracle( + [NotNull] this AbpDbContextOptions options, + [CanBeNull] Action oracleOptionsAction = null) + where TDbContext : AbpDbContext + { + options.Configure(context => + { + context.UseOracle(oracleOptionsAction); + }); + } + } +} diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/Oracle/AbpEntityFrameworkCoreOracleModule.cs b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/Oracle/AbpEntityFrameworkCoreOracleModule.cs index 21fad9375a..b7cbaec1a1 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/Oracle/AbpEntityFrameworkCoreOracleModule.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/Oracle/AbpEntityFrameworkCoreOracleModule.cs @@ -1,22 +1,20 @@ -// using Volo.Abp.Guids; -// using Volo.Abp.Modularity; -// -// namespace Volo.Abp.EntityFrameworkCore.Oracle -// { -// [DependsOn( -// typeof(AbpEntityFrameworkCoreModule) -// )] -// public class AbpEntityFrameworkCoreOracleModule : AbpModule -// { -// public override void ConfigureServices(ServiceConfigurationContext context) -// { -// Configure(options => -// { -// if (options.DefaultSequentialGuidType == null) -// { -// options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary; -// } -// }); -// } -// } -// } +using Volo.Abp.Guids; +using Volo.Abp.Modularity; + +namespace Volo.Abp.EntityFrameworkCore.Oracle +{ + [DependsOn(typeof(AbpEntityFrameworkCoreModule))] + public class AbpEntityFrameworkCoreOracleModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + if (options.DefaultSequentialGuidType == null) + { + options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary; + } + }); + } + } +} diff --git a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs index 77fb28eed5..92f844dd3c 100644 --- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs +++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs @@ -43,7 +43,7 @@ namespace Volo.Abp.Http.Modeling public ApplicationApiDescriptionModel CreateSubModel(string[] modules = null, string[] controllers = null, string[] actions = null) { - var subModel = new ApplicationApiDescriptionModel(); + var subModel = ApplicationApiDescriptionModel.Create();; foreach (var module in Modules.Values) { diff --git a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs index 5c7c53745c..62365b898b 100644 --- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs +++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs @@ -41,17 +41,17 @@ namespace Volo.Abp.Http.Modeling public ControllerApiDescriptionModel AddController(ControllerApiDescriptionModel controller) { - if (Controllers.ContainsKey(controller.ControllerName)) + if (Controllers.ContainsKey(controller.Type)) { - throw new AbpException($"There is already a controller with name: {controller.ControllerName} in module: {RootPath}"); + throw new AbpException($"There is already a controller with type: {controller.Type} in module: {RootPath}"); } - return Controllers[controller.ControllerName] = controller; + return Controllers[controller.Type] = controller; } - public ControllerApiDescriptionModel GetOrAddController(string uniqueName, string name, Type type, [CanBeNull] HashSet ignoredInterfaces = null) + public ControllerApiDescriptionModel GetOrAddController(string name, Type type, [CanBeNull] HashSet ignoredInterfaces = null) { - return Controllers.GetOrAdd(uniqueName, () => ControllerApiDescriptionModel.Create(name, type, ignoredInterfaces)); + return Controllers.GetOrAdd(type.FullName, () => ControllerApiDescriptionModel.Create(name, type, ignoredInterfaces)); } public ModuleApiDescriptionModel CreateSubModel(string[] controllers, string[] actions) diff --git a/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj b/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj index 6f25c447f0..45302cfab3 100644 --- a/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj +++ b/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj @@ -19,7 +19,7 @@ - + diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs index f757efab64..894f68d097 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs @@ -90,29 +90,30 @@ namespace Volo.Abp.RabbitMQ lock (ChannelSendSyncLock) { - QueueBindCommands.TryPeek(out var command); - - switch (command.Type) + if (QueueBindCommands.TryPeek(out var command)) { - case QueueBindType.Bind: - Channel.QueueBind( - queue: Queue.QueueName, - exchange: Exchange.ExchangeName, - routingKey: command.RoutingKey - ); - break; - case QueueBindType.Unbind: - Channel.QueueUnbind( - queue: Queue.QueueName, - exchange: Exchange.ExchangeName, - routingKey: command.RoutingKey - ); - break; - default: - throw new AbpException($"Unknown {nameof(QueueBindType)}: {command.Type}"); + switch (command.Type) + { + case QueueBindType.Bind: + Channel.QueueBind( + queue: Queue.QueueName, + exchange: Exchange.ExchangeName, + routingKey: command.RoutingKey + ); + break; + case QueueBindType.Unbind: + Channel.QueueUnbind( + queue: Queue.QueueName, + exchange: Exchange.ExchangeName, + routingKey: command.RoutingKey + ); + break; + default: + throw new AbpException($"Unknown {nameof(QueueBindType)}: {command.Type}"); + } + + QueueBindCommands.TryDequeue(out command); } - - QueueBindCommands.TryDequeue(out command); } } } diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs index 52ef5c50de..401a527b1f 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs @@ -43,7 +43,7 @@ namespace Volo.Abp.Settings return value; } - public async Task> GetAllAsync(string[] names) + public virtual async Task> GetAllAsync(string[] names) { var result = new Dictionary(); var settingDefinitions = SettingDefinitionManager.GetAll().Where(x => names.Contains(x.Name)).ToList(); diff --git a/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj b/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj index 9a720524d9..d2d0f0f13a 100644 --- a/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj +++ b/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj @@ -15,7 +15,7 @@ - + diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs index b69383d26f..ed2697a8d8 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs @@ -1,11 +1,12 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Auditing; using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; using Volo.Abp.Validation; namespace Volo.Abp.Account { - public class RegisterDto + public class RegisterDto : ExtensibleObject { [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] @@ -25,4 +26,4 @@ namespace Volo.Abp.Account [Required] public string AppName { get; set; } } -} \ No newline at end of file +} diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs index 731c64fc52..05ff98b35b 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs @@ -6,6 +6,7 @@ using Volo.Abp.Account.Localization; using Volo.Abp.Account.Settings; using Volo.Abp.Application.Services; using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; using Volo.Abp.Settings; namespace Volo.Abp.Account @@ -42,6 +43,8 @@ namespace Volo.Abp.Account var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id); + input.MapExtraPropertiesTo(user); + (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); await UserManager.SetEmailAsync(user,input.EmailAddress); diff --git a/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs b/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs index b108d08b02..e7963d7c39 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Host.Shared/FeatureConfigurer.cs @@ -13,7 +13,6 @@ namespace Volo.CmsKit OneTimeRunner.Run(() => { GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll(); - GlobalFeatureManager.Instance.Modules.CmsKit().Disable(); }); } } diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201224140744_Initial.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201224140744_Initial.Designer.cs deleted file mode 100644 index 7ced9b3a54..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201224140744_Initial.Designer.cs +++ /dev/null @@ -1,1576 +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; - -namespace Volo.CmsKit.Migrations -{ - [DbContext(typeof(UnifiedDbContext))] - [Migration("20201224140744_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); - - 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") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)") - .HasColumnName("Exceptions"); - - 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("ImpersonatorUserId") - .HasColumnType("uniqueidentifier") - .HasColumnName("ImpersonatorUserId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("TenantName") - .HasColumnType("nvarchar(max)"); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - - b.ToTable("AbpFeatureValues"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - 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"); - - b.ToTable("AbpSettings"); - }); - - 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"); - }); - - 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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Comments.Comment", 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("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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Contents.Content", 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("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("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId"); - - b.ToTable("CmsContents"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("HexColor") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - 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"); - }); - - 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("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"); - }); - - 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.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.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/20201225120048_Added_Page.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201225120048_Added_Page.Designer.cs deleted file mode 100644 index 06fcbe43a4..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201225120048_Added_Page.Designer.cs +++ /dev/null @@ -1,1647 +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; - -namespace Volo.CmsKit.Migrations -{ - [DbContext(typeof(UnifiedDbContext))] - [Migration("20201225120048_Added_Page")] - partial class Added_Page - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); - - 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") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)") - .HasColumnName("Exceptions"); - - 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("ImpersonatorUserId") - .HasColumnType("uniqueidentifier") - .HasColumnName("ImpersonatorUserId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("TenantName") - .HasColumnType("nvarchar(max)"); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - - b.ToTable("AbpFeatureValues"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - 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"); - - b.ToTable("AbpSettings"); - }); - - 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"); - }); - - 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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Comments.Comment", 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("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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Contents.Content", 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("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("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId"); - - b.ToTable("CmsContents"); - }); - - 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("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("Description") - .HasMaxLength(515) - .HasColumnType("nvarchar(515)"); - - 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("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Url"); - - b.ToTable("CmsPages"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("HexColor") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - 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"); - }); - - 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("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"); - }); - - 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.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.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/20201225120048_Added_Page.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201225120048_Added_Page.cs deleted file mode 100644 index 119009c8e1..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201225120048_Added_Page.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Volo.CmsKit.Migrations -{ - public partial class Added_Page : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "CmsPages", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - Url = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - Description = table.Column(type: "nvarchar(515)", maxLength: 515, 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), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_CmsPages", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_CmsPages_TenantId_Url", - table: "CmsPages", - columns: new[] { "TenantId", "Url" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CmsPages"); - } - } -} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201228083120_Updated_Tag_Removed_HexColor.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201228083120_Updated_Tag_Removed_HexColor.Designer.cs deleted file mode 100644 index 8f90204baa..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201228083120_Updated_Tag_Removed_HexColor.Designer.cs +++ /dev/null @@ -1,1643 +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; - -namespace Volo.CmsKit.Migrations -{ - [DbContext(typeof(UnifiedDbContext))] - [Migration("20201228083120_Updated_Tag_Removed_HexColor")] - partial class Updated_Tag_Removed_HexColor - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); - - 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") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)") - .HasColumnName("Exceptions"); - - 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("ImpersonatorUserId") - .HasColumnType("uniqueidentifier") - .HasColumnName("ImpersonatorUserId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("TenantName") - .HasColumnType("nvarchar(max)"); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - - b.ToTable("AbpFeatureValues"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - 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"); - - b.ToTable("AbpSettings"); - }); - - 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"); - }); - - 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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Comments.Comment", 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("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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Contents.Content", 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("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("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId"); - - b.ToTable("CmsContents"); - }); - - 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("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("Description") - .HasMaxLength(515) - .HasColumnType("nvarchar(515)"); - - 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("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Url"); - - b.ToTable("CmsPages"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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.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.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/20201228083120_Updated_Tag_Removed_HexColor.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201228083120_Updated_Tag_Removed_HexColor.cs deleted file mode 100644 index 476f4ea87e..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201228083120_Updated_Tag_Removed_HexColor.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Volo.CmsKit.Migrations -{ - public partial class Updated_Tag_Removed_HexColor : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "HexColor", - table: "CmsTags"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "HexColor", - table: "CmsTags", - type: "nvarchar(6)", - maxLength: 6, - nullable: true); - } - } -} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201231111657_Added_Blob_Storing.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201231111657_Added_Blob_Storing.Designer.cs deleted file mode 100644 index 15e01fa673..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201231111657_Added_Blob_Storing.Designer.cs +++ /dev/null @@ -1,1725 +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; - -namespace Volo.CmsKit.Migrations -{ - [DbContext(typeof(UnifiedDbContext))] - [Migration("20201231111657_Added_Blob_Storing")] - partial class Added_Blob_Storing - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); - - 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") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)") - .HasColumnName("Exceptions"); - - 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("ImpersonatorUserId") - .HasColumnType("uniqueidentifier") - .HasColumnName("ImpersonatorUserId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("TenantName") - .HasColumnType("nvarchar(max)"); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - - b.ToTable("AbpFeatureValues"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - 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"); - - b.ToTable("AbpSettings"); - }); - - 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"); - }); - - 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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Comments.Comment", 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("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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Contents.Content", 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("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("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId"); - - b.ToTable("CmsContents"); - }); - - 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("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("Description") - .HasMaxLength(512) - .HasColumnType("nvarchar(512)"); - - 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("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Url"); - - b.ToTable("CmsPages"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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.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/20201231111657_Added_Blob_Storing.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201231111657_Added_Blob_Storing.cs deleted file mode 100644 index 11cf1901fa..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201231111657_Added_Blob_Storing.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Volo.CmsKit.Migrations -{ - public partial class Added_Blob_Storing : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Description", - table: "CmsPages", - type: "nvarchar(512)", - maxLength: 512, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(515)", - oldMaxLength: 515, - oldNullable: true); - - migrationBuilder.CreateTable( - name: "AbpBlobContainers", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpBlobContainers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpBlobs", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ContainerId = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - Content = table.Column(type: "varbinary(max)", maxLength: 2147483647, nullable: true), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpBlobs", x => x.Id); - table.ForeignKey( - name: "FK_AbpBlobs_AbpBlobContainers_ContainerId", - column: x => x.ContainerId, - principalTable: "AbpBlobContainers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AbpBlobContainers_TenantId_Name", - table: "AbpBlobContainers", - columns: new[] { "TenantId", "Name" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpBlobs_ContainerId", - table: "AbpBlobs", - column: "ContainerId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpBlobs_TenantId_ContainerId_Name", - table: "AbpBlobs", - columns: new[] { "TenantId", "ContainerId", "Name" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AbpBlobs"); - - migrationBuilder.DropTable( - name: "AbpBlobContainers"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "CmsPages", - type: "nvarchar(515)", - maxLength: 515, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(512)", - oldMaxLength: 512, - oldNullable: true); - } - } -} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210209082122_UrlSlugToSlug.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210209082122_UrlSlugToSlug.cs deleted file mode 100644 index d4ee6baf56..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210209082122_UrlSlugToSlug.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Volo.CmsKit.Migrations -{ - public partial class UrlSlugToSlug : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "CmsBlogPosts", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - BlogId = table.Column(type: "uniqueidentifier", nullable: false), - Title = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Slug = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - ShortDescription = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - TenantId = table.Column(type: "uniqueidentifier", 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), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_CmsBlogPosts", x => x.Id); - table.ForeignKey( - name: "FK_CmsBlogPosts_CmsUsers_CreatorId", - column: x => x.CreatorId, - principalTable: "CmsUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_CmsBlogPosts_CmsUsers_DeleterId", - column: x => x.DeleterId, - principalTable: "CmsUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_CmsBlogPosts_CmsUsers_LastModifierId", - column: x => x.LastModifierId, - principalTable: "CmsUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "CmsBlogs", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Slug = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - TenantId = table.Column(type: "uniqueidentifier", 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), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_CmsBlogs", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_CmsBlogPosts_CreatorId", - table: "CmsBlogPosts", - column: "CreatorId"); - - migrationBuilder.CreateIndex( - name: "IX_CmsBlogPosts_DeleterId", - table: "CmsBlogPosts", - column: "DeleterId"); - - migrationBuilder.CreateIndex( - name: "IX_CmsBlogPosts_LastModifierId", - table: "CmsBlogPosts", - column: "LastModifierId"); - - migrationBuilder.CreateIndex( - name: "IX_CmsBlogPosts_Slug_BlogId", - table: "CmsBlogPosts", - columns: new[] { "Slug", "BlogId" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CmsBlogPosts"); - - migrationBuilder.DropTable( - name: "CmsBlogs"); - } - } -} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210210105857_Added_Media.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210210105857_Added_Media.cs deleted file mode 100644 index 46abf1b3b0..0000000000 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210210105857_Added_Media.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Volo.CmsKit.Migrations -{ - public partial class Added_Media : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CmsPages"); - - migrationBuilder.CreateTable( - name: "CmsMediaDescriptors", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false), - MimeType = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Size = table.Column(type: "bigint", maxLength: 2147483647, 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), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_CmsMediaDescriptors", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CmsMediaDescriptors"); - - migrationBuilder.CreateTable( - name: "CmsPages", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true), - Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - Url = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CmsPages", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_CmsPages_TenantId_Url", - table: "CmsPages", - columns: new[] { "TenantId", "Url" }); - } - } -} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210210105857_Added_Media.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219113255_Initial.Designer.cs similarity index 93% rename from modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210210105857_Added_Media.Designer.cs rename to modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219113255_Initial.Designer.cs index 14b807eb67..2fb20c8941 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210210105857_Added_Media.Designer.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219113255_Initial.Designer.cs @@ -11,8 +11,8 @@ using Volo.CmsKit.EntityFrameworkCore; namespace Volo.CmsKit.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20210210105857_Added_Media")] - partial class Added_Media + [Migration("20210219113255_Initial")] + partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -1191,6 +1191,68 @@ namespace Volo.CmsKit.Migrations b.ToTable("CmsBlogs"); }); + 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("Enabled") + .HasColumnType("bit"); + + 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("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.ToTable("CmsBlogFeatures"); + }); + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => { b.Property("Id") @@ -1457,6 +1519,77 @@ namespace Volo.CmsKit.Migrations b.ToTable("CmsMediaDescriptors"); }); + 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("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("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + 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("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + 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"); + }); + modelBuilder.Entity("Volo.CmsKit.Ratings.Rating", b => { b.Property("Id") diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201224140744_Initial.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219113255_Initial.cs similarity index 78% rename from modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201224140744_Initial.cs rename to modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219113255_Initial.cs index 826acae0d9..083f0de402 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20201224140744_Initial.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219113255_Initial.cs @@ -39,6 +39,21 @@ namespace Volo.CmsKit.Migrations table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpBlobContainers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBlobContainers", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpClaimTypes", columns: table => new @@ -251,6 +266,52 @@ namespace Volo.CmsKit.Migrations table.PrimaryKey("PK_AbpUsers", x => x.Id); }); + migrationBuilder.CreateTable( + name: "CmsBlogFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BlogId = table.Column(type: "uniqueidentifier", nullable: false), + FeatureName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Enabled = table.Column(type: "bit", 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), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsBlogFeatures", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CmsBlogs", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Slug = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + TenantId = table.Column(type: "uniqueidentifier", 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), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsBlogs", x => x.Id); + }); + migrationBuilder.CreateTable( name: "CmsComments", columns: table => new @@ -306,6 +367,54 @@ namespace Volo.CmsKit.Migrations table.PrimaryKey("PK_CmsEntityTags", x => new { x.EntityId, x.TagId }); }); + migrationBuilder.CreateTable( + name: "CmsMediaDescriptors", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false), + MimeType = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Size = table.Column(type: "bigint", maxLength: 2147483647, 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), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsMediaDescriptors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CmsPages", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Slug = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = 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), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsPages", x => x.Id); + }); + migrationBuilder.CreateTable( name: "CmsRatings", columns: table => new @@ -328,10 +437,9 @@ namespace Volo.CmsKit.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), EntityType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Name = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: false), - HexColor = table.Column(type: "nvarchar(6)", maxLength: 6, nullable: true), - TenantId = table.Column(type: "uniqueidentifier", 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), @@ -435,6 +543,29 @@ namespace Volo.CmsKit.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "AbpBlobs", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ContainerId = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Content = table.Column(type: "varbinary(max)", maxLength: 2147483647, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBlobs", x => x.Id); + table.ForeignKey( + name: "FK_AbpBlobs_AbpBlobContainers_ContainerId", + column: x => x.ContainerId, + principalTable: "AbpBlobContainers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "AbpOrganizationUnitRoles", columns: table => new @@ -617,6 +748,49 @@ namespace Volo.CmsKit.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "CmsBlogPosts", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BlogId = table.Column(type: "uniqueidentifier", nullable: false), + Title = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Slug = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ShortDescription = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + TenantId = table.Column(type: "uniqueidentifier", 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), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsBlogPosts", x => x.Id); + table.ForeignKey( + name: "FK_CmsBlogPosts_CmsUsers_CreatorId", + column: x => x.CreatorId, + principalTable: "CmsUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CmsBlogPosts_CmsUsers_DeleterId", + column: x => x.DeleterId, + principalTable: "CmsUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_CmsBlogPosts_CmsUsers_LastModifierId", + column: x => x.LastModifierId, + principalTable: "CmsUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "AbpEntityPropertyChanges", columns: table => new @@ -660,6 +834,21 @@ namespace Volo.CmsKit.Migrations table: "AbpAuditLogs", columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + migrationBuilder.CreateIndex( + name: "IX_AbpBlobContainers_TenantId_Name", + table: "AbpBlobContainers", + columns: new[] { "TenantId", "Name" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpBlobs_ContainerId", + table: "AbpBlobs", + column: "ContainerId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpBlobs_TenantId_ContainerId_Name", + table: "AbpBlobs", + columns: new[] { "TenantId", "ContainerId", "Name" }); + migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_AuditLogId", table: "AbpEntityChanges", @@ -787,6 +976,26 @@ namespace Volo.CmsKit.Migrations table: "AbpUsers", column: "UserName"); + migrationBuilder.CreateIndex( + name: "IX_CmsBlogPosts_CreatorId", + table: "CmsBlogPosts", + column: "CreatorId"); + + migrationBuilder.CreateIndex( + name: "IX_CmsBlogPosts_DeleterId", + table: "CmsBlogPosts", + column: "DeleterId"); + + migrationBuilder.CreateIndex( + name: "IX_CmsBlogPosts_LastModifierId", + table: "CmsBlogPosts", + column: "LastModifierId"); + + migrationBuilder.CreateIndex( + name: "IX_CmsBlogPosts_Slug_BlogId", + table: "CmsBlogPosts", + columns: new[] { "Slug", "BlogId" }); + migrationBuilder.CreateIndex( name: "IX_CmsComments_TenantId_EntityType_EntityId", table: "CmsComments", @@ -807,6 +1016,11 @@ namespace Volo.CmsKit.Migrations table: "CmsEntityTags", columns: new[] { "TenantId", "EntityId", "TagId" }); + migrationBuilder.CreateIndex( + name: "IX_CmsPages_TenantId_Slug", + table: "CmsPages", + columns: new[] { "TenantId", "Slug" }); + migrationBuilder.CreateIndex( name: "IX_CmsRatings_TenantId_EntityType_EntityId_CreatorId", table: "CmsRatings", @@ -843,6 +1057,9 @@ namespace Volo.CmsKit.Migrations migrationBuilder.DropTable( name: "AbpAuditLogActions"); + migrationBuilder.DropTable( + name: "AbpBlobs"); + migrationBuilder.DropTable( name: "AbpClaimTypes"); @@ -888,6 +1105,15 @@ namespace Volo.CmsKit.Migrations migrationBuilder.DropTable( name: "AbpUserTokens"); + migrationBuilder.DropTable( + name: "CmsBlogFeatures"); + + migrationBuilder.DropTable( + name: "CmsBlogPosts"); + + migrationBuilder.DropTable( + name: "CmsBlogs"); + migrationBuilder.DropTable( name: "CmsComments"); @@ -897,6 +1123,12 @@ namespace Volo.CmsKit.Migrations migrationBuilder.DropTable( name: "CmsEntityTags"); + migrationBuilder.DropTable( + name: "CmsMediaDescriptors"); + + migrationBuilder.DropTable( + name: "CmsPages"); + migrationBuilder.DropTable( name: "CmsRatings"); @@ -907,7 +1139,7 @@ namespace Volo.CmsKit.Migrations name: "CmsUserReactions"); migrationBuilder.DropTable( - name: "CmsUsers"); + name: "AbpBlobContainers"); migrationBuilder.DropTable( name: "AbpEntityChanges"); @@ -924,6 +1156,9 @@ namespace Volo.CmsKit.Migrations migrationBuilder.DropTable( name: "AbpUsers"); + migrationBuilder.DropTable( + name: "CmsUsers"); + migrationBuilder.DropTable( name: "AbpAuditLogs"); } diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210209082122_UrlSlugToSlug.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219144454_BlogFeatureEnabledColumnRename.Designer.cs similarity index 92% rename from modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210209082122_UrlSlugToSlug.Designer.cs rename to modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219144454_BlogFeatureEnabledColumnRename.Designer.cs index ef06bb2fd9..dbc62a176a 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210209082122_UrlSlugToSlug.Designer.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219144454_BlogFeatureEnabledColumnRename.Designer.cs @@ -11,17 +11,17 @@ using Volo.CmsKit.EntityFrameworkCore; namespace Volo.CmsKit.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20210209082122_UrlSlugToSlug")] - partial class UrlSlugToSlug + [Migration("20210219144454_BlogFeatureEnabledColumnRename")] + partial class BlogFeatureEnabledColumnRename { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .UseIdentityColumns() .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.2"); + .HasAnnotation("ProductVersion", "5.0.3") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { @@ -1191,6 +1191,68 @@ namespace Volo.CmsKit.Migrations b.ToTable("CmsBlogs"); }); + 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"); + }); + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => { b.Property("Id") @@ -1388,6 +1450,75 @@ namespace Volo.CmsKit.Migrations b.ToTable("CmsContents"); }); + 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("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"); + }); + modelBuilder.Entity("Volo.CmsKit.Pages.Page", b => { b.Property("Id") @@ -1438,6 +1569,11 @@ namespace Volo.CmsKit.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); @@ -1447,14 +1583,9 @@ namespace Volo.CmsKit.Migrations .HasMaxLength(256) .HasColumnType("nvarchar(256)"); - b.Property("Url") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - b.HasKey("Id"); - b.HasIndex("TenantId", "Url"); + b.HasIndex("TenantId", "Slug"); b.ToTable("CmsPages"); }); diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219144454_BlogFeatureEnabledColumnRename.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219144454_BlogFeatureEnabledColumnRename.cs new file mode 100644 index 0000000000..be63651c98 --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210219144454_BlogFeatureEnabledColumnRename.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Volo.CmsKit.Migrations +{ + public partial class BlogFeatureEnabledColumnRename : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Enabled", + table: "CmsBlogFeatures", + newName: "IsEnabled"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "IsEnabled", + table: "CmsBlogFeatures", + newName: "Enabled"); + } + } +} 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 80080860e9..98151c5569 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 @@ -1,1887 +1,2020 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Volo.Abp.EntityFrameworkCore; -using Volo.CmsKit.EntityFrameworkCore; - -namespace Volo.CmsKit.Migrations -{ - [DbContext(typeof(UnifiedDbContext))] - partial class UnifiedDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.3") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - 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") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)") - .HasColumnName("Exceptions"); - - 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("ImpersonatorUserId") - .HasColumnType("uniqueidentifier") - .HasColumnName("ImpersonatorUserId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("TenantName") - .HasColumnType("nvarchar(max)"); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - - b.ToTable("AbpFeatureValues"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - 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"); - - b.ToTable("AbpSettings"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", 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("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("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("CreatorId"); - - b.HasIndex("DeleterId"); - - b.HasIndex("LastModifierId"); - - b.HasIndex("Slug", "BlogId"); - - b.ToTable("CmsBlogPosts"); - }); - - modelBuilder.Entity("Volo.CmsKit.Comments.Comment", 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("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"); - }); - - modelBuilder.Entity("Volo.CmsKit.Contents.Content", 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("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("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId"); - - b.ToTable("CmsContents"); - }); - - 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("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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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"); - }); - - 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("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"); - }); - - 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", "Creator") - .WithMany() - .HasForeignKey("CreatorId"); - - b.HasOne("Volo.CmsKit.Users.CmsUser", "Deleter") - .WithMany() - .HasForeignKey("DeleterId"); - - b.HasOne("Volo.CmsKit.Users.CmsUser", "LastModifier") - .WithMany() - .HasForeignKey("LastModifierId"); - - b.Navigation("Creator"); - - b.Navigation("Deleter"); - - b.Navigation("LastModifier"); - }); - - 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 - } - } -} +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Volo.CmsKit.EntityFrameworkCore; + +namespace Volo.CmsKit.Migrations +{ + [DbContext(typeof(UnifiedDbContext))] + partial class UnifiedDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.3") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + 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") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)") + .HasColumnName("Exceptions"); + + 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("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + + b.ToTable("AbpFeatureValues"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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("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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + 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"); + + b.ToTable("AbpSettings"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", 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("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("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("CreatorId"); + + b.HasIndex("DeleterId"); + + b.HasIndex("LastModifierId"); + + b.HasIndex("Slug", "BlogId"); + + b.ToTable("CmsBlogPosts"); + }); + + modelBuilder.Entity("Volo.CmsKit.Comments.Comment", 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("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"); + }); + + modelBuilder.Entity("Volo.CmsKit.Contents.Content", 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("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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId"); + + b.ToTable("CmsContents"); + }); + + 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("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"); + }); + + 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("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("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + 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("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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"); + }); + + 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("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"); + }); + + 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", "Creator") + .WithMany() + .HasForeignKey("CreatorId"); + + b.HasOne("Volo.CmsKit.Users.CmsUser", "Deleter") + .WithMany() + .HasForeignKey("DeleterId"); + + b.HasOne("Volo.CmsKit.Users.CmsUser", "LastModifier") + .WithMany() + .HasForeignKey("LastModifierId"); + + b.Navigation("Creator"); + + b.Navigation("Deleter"); + + b.Navigation("LastModifier"); + }); + + 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/Volo.CmsKit.Web.Unified.csproj b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj index f13af43d96..61be8d09f5 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj @@ -10,7 +10,6 @@ - @@ -63,4 +62,8 @@ + + + + diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogFeatureInputDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogFeatureInputDto.cs new file mode 100644 index 0000000000..aebbc58e26 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogFeatureInputDto.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; + +namespace Volo.CmsKit.Admin.Blogs +{ + public class BlogFeatureInputDto + { + [Required] + public string FeatureName { get; set; } + public bool IsEnabled { get; set; } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogLookupDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogLookupDto.cs deleted file mode 100644 index ed514d839d..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogLookupDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace Volo.CmsKit.Admin.Blogs -{ - public class BlogLookupDto - { - public Guid Id { get; set; } - public string Name { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateUpdateBlogPostDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateBlogPostDto.cs similarity index 94% rename from modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateUpdateBlogPostDto.cs rename to modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateBlogPostDto.cs index 4c0532129d..a8423a7300 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateUpdateBlogPostDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateBlogPostDto.cs @@ -5,7 +5,7 @@ using Volo.CmsKit.Blogs; namespace Volo.CmsKit.Admin.Blogs { - public class CreateUpdateBlogPostDto + public class CreateBlogPostDto { [Required] public Guid BlogId { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogAdminAppService.cs index f0485cc344..3544b3d7af 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogAdminAppService.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Volo.Abp.Application.Services; namespace Volo.CmsKit.Admin.Blogs diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogFeatureAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogFeatureAdminAppService.cs new file mode 100644 index 0000000000..008081367d --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogFeatureAdminAppService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.CmsKit.Blogs; + +namespace Volo.CmsKit.Admin.Blogs +{ + public interface IBlogFeatureAdminAppService + { + Task SetAsync(Guid blogId, BlogFeatureInputDto dto); + + Task> GetListAsync(Guid blogId); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs index 28d614d289..aa110fe938 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs @@ -11,7 +11,8 @@ namespace Volo.CmsKit.Admin.Blogs BlogPostDto, Guid, PagedAndSortedResultRequestDto, - CreateUpdateBlogPostDto> + CreateBlogPostDto, + UpdateBlogPostDto> { Task GetBySlugAsync(string blogSlug, string slug); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/UpdateBlogPostDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/UpdateBlogPostDto.cs new file mode 100644 index 0000000000..909d8e2e9e --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/UpdateBlogPostDto.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Validation; +using Volo.CmsKit.Blogs; + +namespace Volo.CmsKit.Admin.Blogs +{ + public class UpdateBlogPostDto + { + [Required] + [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxTitleLength))] + public string Title { get; set; } + + [Required] + [DynamicStringLength( + typeof(BlogPostConsts), + nameof(BlogPostConsts.MaxSlugLength), + nameof(BlogPostConsts.MinSlugLength))] + public string Slug { get; set; } + + [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxShortDescriptionLength))] + public string ShortDescription { get; set; } + + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CmsUserDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CmsUserDto.cs new file mode 100644 index 0000000000..90eb3d7fb2 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CmsUserDto.cs @@ -0,0 +1,15 @@ +using System; + +namespace Volo.CmsKit.Admin.Comments +{ + public class CmsUserDto + { + public Guid Id { get; set; } + + public string UserName { get; set; } + + public string Name { get; set; } + + public string Surname { get; set; } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentDto.cs new file mode 100644 index 0000000000..bf43a1e50a --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentDto.cs @@ -0,0 +1,21 @@ +using System; + +namespace Volo.CmsKit.Admin.Comments +{ + public class CommentDto + { + public Guid Id { get; set; } + + public string EntityType { get; set; } + + public string EntityId { get; set; } + + public string Text { get; set; } + + public Guid? RepliedCommentId { get; set; } + + public Guid CreatorId { get; set; } + + public DateTime CreationTime { get; set; } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs new file mode 100644 index 0000000000..f2d14c8153 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs @@ -0,0 +1,22 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Volo.CmsKit.Admin.Comments +{ + public class CommentGetListInput : PagedAndSortedResultRequestDto + { + public string EntityType { get; set; } + + public string EntityId { get; set; } + + public string Text { get; set; } + + public Guid? RepliedCommentId { get; set; } + + public string Author { get; set; } + + public DateTime? CreationStartDate { get; set; } + + public DateTime? CreationEndDate { get; set; } + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..833a52180b --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentWithAuthorDto.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using Volo.CmsKit.Users; + +namespace Volo.CmsKit.Admin.Comments +{ + public class CommentWithAuthorDto + { + public Guid Id { get; set; } + + public string EntityType { get; set; } + + public string EntityId { get; set; } + + public string Text { get; set; } + + public Guid? RepliedCommentId { get; set; } + + public Guid CreatorId { get; set; } + + public DateTime CreationTime { get; set; } + + public CmsUserDto Author { get; set; } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/ICommentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/ICommentAdminAppService.cs new file mode 100644 index 0000000000..2bddc35a25 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/ICommentAdminAppService.cs @@ -0,0 +1,16 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Volo.CmsKit.Admin.Comments +{ + public interface ICommentAdminAppService : IApplicationService + { + Task> GetListAsync(CommentGetListInput input); + + Task GetAsync(Guid id); + + Task DeleteAsync(Guid id); + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs index d2ddfe6e88..c7398945dc 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs @@ -12,8 +12,8 @@ namespace Volo.CmsKit.Admin.Pages public string Title { get; set; } [Required] - [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxUrlLength))] - public string Url { get; set; } + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] + public string Slug { get; set; } [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxDescriptionLength))] public string Description { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs index 3aebb76b51..23b42a48dc 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs @@ -7,7 +7,7 @@ namespace Volo.CmsKit.Admin.Pages { public string Title { get; set; } - public string Url { get; set; } + public string Slug { get; set; } public string Description { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs index 17b3c948bd..4dba6faac0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs @@ -12,8 +12,8 @@ namespace Volo.CmsKit.Admin.Pages public string Title { get; set; } [Required] - [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxUrlLength))] - public string Url { get; set; } + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] + public string Slug { get; set; } [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxDescriptionLength))] public string Description { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs index a5a30a60ef..ccb4d1048b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs @@ -13,6 +13,12 @@ namespace Volo.CmsKit.Permissions { var cmsGroup = context.GetGroupOrNull(CmsKitAdminPermissions.GroupName) ?? context.AddGroup(CmsKitAdminPermissions.GroupName, L("Permission:CmsKit")); + if (GlobalFeatureManager.Instance.IsEnabled()) + { + var contentGroup = cmsGroup.AddPermission(CmsKitAdminPermissions.Comments.Default, L("Permission:Comments")); + contentGroup.AddChild(CmsKitAdminPermissions.Comments.Delete, L("Permission:Comments.Delete")); + } + if (GlobalFeatureManager.Instance.IsEnabled()) { var contentGroup = cmsGroup.AddPermission(CmsKitAdminPermissions.Contents.Default, L("Permission:Contents")); @@ -20,6 +26,7 @@ namespace Volo.CmsKit.Permissions contentGroup.AddChild(CmsKitAdminPermissions.Contents.Update, L("Permission:Contents.Update")); contentGroup.AddChild(CmsKitAdminPermissions.Contents.Delete, L("Permission:Contents.Delete")); } + if (GlobalFeatureManager.Instance.IsEnabled()) { var tagGroup = cmsGroup.AddPermission(CmsKitAdminPermissions.Tags.Default, L("Permission:TagManagement")); @@ -42,6 +49,7 @@ namespace Volo.CmsKit.Permissions blogManagement.AddChild(CmsKitAdminPermissions.Blogs.Create, L("Permission:BlogManagement.Create")); blogManagement.AddChild(CmsKitAdminPermissions.Blogs.Update, L("Permission:BlogManagement.Update")); blogManagement.AddChild(CmsKitAdminPermissions.Blogs.Delete, L("Permission:BlogManagement.Delete")); + blogManagement.AddChild(CmsKitAdminPermissions.Blogs.Features, L("Permission:BlogManagement.Features")); var blogPostManagement = cmsGroup.AddPermission(CmsKitAdminPermissions.BlogPosts.Default, L("Permission:BlogPostManagement")); blogManagement.AddChild(CmsKitAdminPermissions.BlogPosts.Create, L("Permission:BlogPostManagement.Create")); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs index 4c106d4d3c..6de7bad5e4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs @@ -6,6 +6,12 @@ namespace Volo.CmsKit.Permissions { public const string GroupName = "CmsKit"; + public static class Comments + { + public const string Default = GroupName + ".Comments"; + public const string Delete = Default + ".Delete"; + } + public static class Tags { public const string Default = GroupName + ".Tags"; @@ -36,6 +42,7 @@ namespace Volo.CmsKit.Permissions public const string Create = Default + ".Create"; public const string Update = Default + ".Update"; public const string Delete = Default + ".Delete"; + public const string Features = Default + ".Features"; } public static class BlogPosts diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminAppService.cs new file mode 100644 index 0000000000..c712ea5048 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminAppService.cs @@ -0,0 +1,49 @@ +using Microsoft.AspNetCore.Authorization; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Admin.Blogs; +using Volo.CmsKit.Blogs; +using Volo.CmsKit.GlobalFeatures; +using Volo.CmsKit.Permissions; + +namespace Volo.CmsKit.Admin.Blogs +{ + [RequiresGlobalFeature(typeof(BlogsFeature))] + public class BlogFeatureAdminAppService : CmsKitAdminAppServiceBase, IBlogFeatureAdminAppService + { + protected IBlogFeatureRepository BlogFeatureRepository { get; } + + protected IBlogFeatureManager BlogFeatureManager { get; } + + protected IDistributedEventBus EventBus { get; } + + public BlogFeatureAdminAppService( + IBlogFeatureRepository blogFeatureRepository, + IBlogFeatureManager blogFeatureManager, + IDistributedEventBus eventBus) + { + BlogFeatureRepository = blogFeatureRepository; + BlogFeatureManager = blogFeatureManager; + EventBus = eventBus; + } + + [Authorize(CmsKitAdminPermissions.Blogs.Features)] + public async Task> GetListAsync(Guid blogId) + { + var blogFeatures = await BlogFeatureManager.GetListAsync(blogId); + + return ObjectMapper.Map, List>(blogFeatures); + } + + [Authorize(CmsKitAdminPermissions.Blogs.Features)] + public Task SetAsync(Guid blogId, BlogFeatureInputDto dto) + { + return BlogFeatureManager.SetAsync(blogId, dto.FeatureName, dto.IsEnabled); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs index 8fa6fb9ff7..fc57121040 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs @@ -23,14 +23,15 @@ namespace Volo.CmsKit.Admin.Blogs BlogPostDto, Guid, PagedAndSortedResultRequestDto, - CreateUpdateBlogPostDto> + CreateBlogPostDto, + UpdateBlogPostDto> , IBlogPostAdminAppService { - protected readonly IBlogPostManager BlogPostManager; - protected readonly IBlogPostRepository BlogPostRepository; - protected readonly IBlogRepository BlogRepository; - protected readonly IBlobContainer BlobContainer; - protected readonly ICmsUserLookupService UserLookupService; + protected IBlogPostManager BlogPostManager { get; } + protected IBlogPostRepository BlogPostRepository { get; } + protected IBlogRepository BlogRepository { get; } + protected IBlobContainer BlobContainer { get; } + protected ICmsUserLookupService UserLookupService { get; } public BlogPostAdminAppService( IRepository repository, @@ -59,11 +60,11 @@ namespace Volo.CmsKit.Admin.Blogs var blogPost = await BlogPostRepository.GetBySlugAsync(blog.Id, blogPostSlug); - return MapToGetOutputDto(blogPost); + return await MapToGetOutputDtoAsync(blogPost); } [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] - public override async Task CreateAsync(CreateUpdateBlogPostDto input) + public override async Task CreateAsync(CreateBlogPostDto input) { _ = await UserLookupService.GetByIdAsync(CurrentUser.GetId()); @@ -76,11 +77,11 @@ namespace Volo.CmsKit.Admin.Blogs input.Slug, input.ShortDescription)); - return MapToGetOutputDto(entity); + return await MapToGetOutputDtoAsync(entity); } [Authorize(CmsKitAdminPermissions.BlogPosts.Update)] - public override async Task UpdateAsync(Guid id, CreateUpdateBlogPostDto input) + public override async Task UpdateAsync(Guid id, UpdateBlogPostDto input) { var blogPost = await BlogPostRepository.GetAsync(id); @@ -95,7 +96,7 @@ namespace Volo.CmsKit.Admin.Blogs await BlogPostManager.UpdateAsync(blogPost); - return MapToGetOutputDto(blogPost); + return await MapToGetOutputDtoAsync(blogPost); } public virtual async Task SetCoverImageAsync(Guid id, RemoteStreamContent streamContent) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs index 33a9d9de84..be14293134 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs @@ -1,14 +1,18 @@ using AutoMapper; +using Volo.Abp.AutoMapper; using Volo.CmsKit.Admin.Blogs; +using Volo.CmsKit.Admin.Comments; using Volo.CmsKit.Admin.Contents; using Volo.CmsKit.Admin.MediaDescriptors; using Volo.CmsKit.Admin.Pages; using Volo.CmsKit.Blogs; using Volo.CmsKit.Admin.Tags; +using Volo.CmsKit.Comments; using Volo.CmsKit.Contents; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.Pages; using Volo.CmsKit.Tags; +using Volo.CmsKit.Users; namespace Volo.CmsKit.Admin { @@ -16,6 +20,12 @@ namespace Volo.CmsKit.Admin { public CmsKitAdminApplicationAutoMapperProfile() { + CreateMap(); + + CreateMap(); + CreateMap() + .Ignore(x=> x.Author); + CreateMap(); CreateMap(MemberList.Destination); @@ -24,12 +34,13 @@ namespace Volo.CmsKit.Admin CreateMap(MemberList.Source); CreateMap(MemberList.Destination); - CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); CreateMap(MemberList.Destination) .ReverseMap(); - CreateMap(MemberList.Destination); + CreateMap(); CreateMap(MemberList.Destination); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs new file mode 100644 index 0000000000..df381fbc2b --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs @@ -0,0 +1,77 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Volo.Abp.Application.Dtos; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Comments; +using Volo.CmsKit.GlobalFeatures; +using Volo.CmsKit.Permissions; +using Volo.CmsKit.Users; + +namespace Volo.CmsKit.Admin.Comments +{ + [RequiresGlobalFeature(typeof(CommentsFeature))] + [Authorize(CmsKitAdminPermissions.Comments.Default)] + public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAppService + { + protected ICommentRepository CommentRepository { get; } + + public CommentAdminAppService(ICommentRepository commentRepository) + { + CommentRepository = commentRepository; + } + + public virtual async Task> GetListAsync(CommentGetListInput input) + { + var totalCount = await CommentRepository.GetCountAsync( + input.Text, + input.EntityType, + input.EntityId, + input.RepliedCommentId, + input.Author, + input.CreationStartDate, + input.CreationEndDate); + + var comments = await CommentRepository.GetListAsync( + input.Text, + input.EntityType, + input.EntityId, + input.RepliedCommentId, + input.Author, + input.CreationStartDate, + input.CreationEndDate, + input.Sorting, + input.MaxResultCount, + input.SkipCount + ); + + var dtos = comments.Select(queryResultItem => + { + var dto = ObjectMapper.Map(queryResultItem.Comment); + dto.Author = ObjectMapper.Map(queryResultItem.Author); + + return dto; + }).ToList(); + + return new PagedResultDto(totalCount, dtos); + } + + public virtual async Task GetAsync(Guid id) + { + var comment = await CommentRepository.GetWithAuthorAsync(id); + + var dto = ObjectMapper.Map(comment.Comment); + dto.Author = ObjectMapper.Map(comment.Author); + + return dto; + } + + [Authorize(CmsKitAdminPermissions.Comments.Delete)] + public virtual async Task DeleteAsync(Guid id) + { + var comment = await CommentRepository.GetAsync(id); + await CommentRepository.DeleteWithRepliesAsync(comment); + } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs index 8ec8559e34..1aa0bffcfa 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs @@ -53,10 +53,10 @@ namespace Volo.CmsKit.Admin.Contents await ContentManager.InsertAsync(entity); - return MapToGetOutputDto(entity); + return await MapToGetOutputDtoAsync(entity); } - public async Task GetAsync( + public virtual async Task GetAsync( [NotNull] string entityType, [NotNull] string entityId) { diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs index 3db45dac95..82ddd6d77e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using AutoMapper; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.GlobalFeatures; @@ -14,7 +15,7 @@ namespace Volo.CmsKit.Admin.Pages [Authorize(CmsKitAdminPermissions.Pages.Default)] public class PageAdminAppService : CmsKitAdminAppServiceBase, IPageAdminAppService { - protected readonly IPageRepository PageRepository; + protected IPageRepository PageRepository { get; } public PageAdminAppService(IPageRepository pageRepository) { @@ -47,9 +48,9 @@ namespace Volo.CmsKit.Admin.Pages [Authorize(CmsKitAdminPermissions.Pages.Create)] public virtual async Task CreateAsync(CreatePageInputDto input) { - await CheckPageUrlAsync(input.Url); + await CheckPageSlugAsync(input.Slug); - var page = new Page(GuidGenerator.Create(), input.Title, input.Url, input.Description, CurrentTenant?.Id); + var page = new Page(GuidGenerator.Create(), input.Title, input.Slug, input.Description, CurrentTenant?.Id); await PageRepository.InsertAsync(page); @@ -61,13 +62,13 @@ namespace Volo.CmsKit.Admin.Pages { var page = await PageRepository.GetAsync(id); - if (page.Url != input.Url) + if (page.Slug != input.Slug) { - await CheckPageUrlAsync(input.Url); + await CheckPageSlugAsync(input.Slug); } - page.Title = input.Title; - page.Url = input.Url; + page.SetTitle(input.Title); + page.SetSlug(input.Slug); page.Description = input.Description; await PageRepository.UpdateAsync(page); @@ -81,11 +82,11 @@ namespace Volo.CmsKit.Admin.Pages await PageRepository.DeleteAsync(id); } - protected virtual async Task CheckPageUrlAsync(string url) + protected virtual async Task CheckPageSlugAsync(string slug) { - if (await PageRepository.ExistsAsync(url)) + if (await PageRepository.ExistsAsync(slug)) { - throw new PageUrlAlreadyExistException(url); + throw new PageSlugAlreadyExistsException(slug); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs index b36ffedbd2..dfa8a00ea3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs @@ -1,19 +1,17 @@ -using System; -using System.Collections.Generic; +using System.Linq; using System.Linq; using System.Threading.Tasks; -using Volo.CmsKit.Admin.Tags; using Volo.CmsKit.Tags; namespace Volo.CmsKit.Admin.Tags { public class EntityTagAdminAppService : CmsKitAdminAppServiceBase, IEntityTagAdminAppService { - protected readonly ITagDefinitionStore _tagDefinitionStore; - protected readonly IEntityTagManager _entityTagManager; - protected readonly ITagManager _tagManager; - protected readonly ITagRepository _tagRepository; - protected readonly IEntityTagRepository _entityTagRepository; + protected ITagDefinitionStore TagDefinitionStore { get; } + protected IEntityTagManager EntityTagManager { get; } + protected ITagManager TagManager { get; } + protected ITagRepository TagRepository { get; } + protected IEntityTagRepository EntityTagRepository { get; } public EntityTagAdminAppService( ITagDefinitionStore tagDefinitionStore, @@ -22,60 +20,61 @@ namespace Volo.CmsKit.Admin.Tags ITagRepository tagRepository, IEntityTagRepository entityTagRepository) { - _tagDefinitionStore = tagDefinitionStore; - _entityTagManager = entityTagManager; - _tagManager = tagManager; - _tagRepository = tagRepository; - _entityTagRepository = entityTagRepository; + TagDefinitionStore = tagDefinitionStore; + EntityTagManager = entityTagManager; + TagManager = tagManager; + TagRepository = tagRepository; + EntityTagRepository = entityTagRepository; } - public async Task AddTagToEntityAsync(EntityTagCreateDto input) + public virtual async Task AddTagToEntityAsync(EntityTagCreateDto input) { - var definition = await _tagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); + var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); await CheckPolicyAsync(definition.CreatePolicy); - var tag = await _tagManager.GetOrAddAsync(input.EntityType, input.TagName, CurrentTenant?.Id); + var tag = await TagManager.GetOrAddAsync(input.EntityType, input.TagName, CurrentTenant?.Id); - await _entityTagManager.AddTagToEntityAsync( + await EntityTagManager.AddTagToEntityAsync( tag.Id, input.EntityType, input.EntityId, CurrentTenant?.Id); } - public async Task RemoveTagFromEntityAsync(EntityTagRemoveDto input) + public virtual async Task RemoveTagFromEntityAsync(EntityTagRemoveDto input) { - var definition = await _tagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); + var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); await CheckPolicyAsync(definition.DeletePolicy); - await _entityTagManager.RemoveTagFromEntityAsync( + await EntityTagManager.RemoveTagFromEntityAsync( input.TagId, input.EntityType, input.EntityId, CurrentTenant?.Id); } - public async Task SetEntityTagsAsync(EntityTagSetDto input) + public virtual async Task SetEntityTagsAsync(EntityTagSetDto input) { - var definition = await _tagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); + var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType); await CheckPolicyAsync(definition.UpdatePolicy); - var existingTags = await _tagRepository.GetAllRelatedTagsAsync(input.EntityType, input.EntityId, CurrentTenant?.Id); + var existingTags = + await TagRepository.GetAllRelatedTagsAsync(input.EntityType, input.EntityId, CurrentTenant?.Id); var deletedTags = existingTags.Where(x => !input.Tags.Contains(x.Name)).ToList(); var addedTags = input.Tags.Where(x => !existingTags.Any(a => a.Name == x)); - await _entityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray()); + await EntityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray()); foreach (var addedTag in addedTags) { - var tag = await _tagManager.GetOrAddAsync(input.EntityType, addedTag, CurrentTenant?.Id); + var tag = await TagManager.GetOrAddAsync(input.EntityType, addedTag, CurrentTenant?.Id); - await _entityTagManager.AddTagToEntityAsync(tag.Id, input.EntityType, input.EntityId, CurrentTenant?.Id); - } + await EntityTagManager.AddTagToEntityAsync(tag.Id, input.EntityType, input.EntityId, CurrentTenant?.Id); + } } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs index eccdaf82c0..15dde35076 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs @@ -50,7 +50,7 @@ namespace Volo.CmsKit.Admin.Tags input.Name, CurrentTenant?.Id); - return MapToGetOutputDto(tag); + return await MapToGetOutputDtoAsync(tag); } [Authorize(CmsKitAdminPermissions.Tags.Update)] @@ -60,7 +60,7 @@ namespace Volo.CmsKit.Admin.Tags id, input.Name); - return MapToGetOutputDto(tag); + return await MapToGetOutputDtoAsync(tag); } protected override IQueryable CreateFilteredQuery(TagGetListInput input) { @@ -72,7 +72,7 @@ namespace Volo.CmsKit.Admin.Tags x.EntityType.ToLower().Contains(input.Filter)); } - public async Task> GetTagDefinitionsAsync() + public virtual async Task> GetTagDefinitionsAsync() { var definitions = await TagManager.GetTagDefinitionsAsync(); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs index d63a3317ce..da565413b1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs @@ -17,7 +17,7 @@ namespace Volo.CmsKit.Admin.Blogs [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] [Area("cms-kit")] [Authorize(CmsKitAdminPermissions.Blogs.Default)] - [Route("api/cms-kit-admin/blogs/blogs")] + [Route("api/cms-kit-admin/blogs")] public class BlogAdminController : CmsKitAdminController, IBlogAdminAppService { protected IBlogAdminAppService BlogAdminAppService { get; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminController.cs new file mode 100644 index 0000000000..46cdf2fe54 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminController.cs @@ -0,0 +1,40 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Blogs; +using Volo.CmsKit.GlobalFeatures; +using Volo.CmsKit.Permissions; + +namespace Volo.CmsKit.Admin.Blogs +{ + [RequiresGlobalFeature(typeof(BlogsFeature))] + [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] + [Area("cms-kit")] + [Authorize(CmsKitAdminPermissions.Blogs.Features)] + [Route("api/cms-kit-admin/blogs/{blogId}/features")] + public class BlogFeatureAdminController : CmsKitAdminController, IBlogFeatureAdminAppService + { + protected IBlogFeatureAdminAppService BlogFeatureAdminAppService { get; } + + public BlogFeatureAdminController(IBlogFeatureAdminAppService blogFeatureAdminAppService) + { + BlogFeatureAdminAppService = blogFeatureAdminAppService; + } + + [HttpGet] + public Task> GetListAsync(Guid blogId) + { + return BlogFeatureAdminAppService.GetListAsync(blogId); + } + + [HttpPut] + public Task SetAsync(Guid blogId, BlogFeatureInputDto dto) + { + return BlogFeatureAdminAppService.SetAsync(blogId, dto); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs index 6c7e78de50..92d23dff4d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs @@ -31,7 +31,7 @@ namespace Volo.CmsKit.Admin.Blogs [HttpPost] [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] - public virtual Task CreateAsync(CreateUpdateBlogPostDto input) + public virtual Task CreateAsync(CreateBlogPostDto input) { return BlogPostAdminAppService.CreateAsync(input); } @@ -107,7 +107,7 @@ namespace Volo.CmsKit.Admin.Blogs [HttpPut] [Route("{id}")] [Authorize(CmsKitAdminPermissions.BlogPosts.Update)] - public virtual Task UpdateAsync(Guid id, CreateUpdateBlogPostDto input) + public virtual Task UpdateAsync(Guid id, UpdateBlogPostDto input) { return BlogPostAdminAppService.UpdateAsync(id, input); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs new file mode 100644 index 0000000000..91482d137a --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs @@ -0,0 +1,48 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.GlobalFeatures; +using Volo.CmsKit.Permissions; + +namespace Volo.CmsKit.Admin.Comments +{ + [Authorize(CmsKitAdminPermissions.Comments.Default)] + [RequiresGlobalFeature(typeof(CommentsFeature))] + [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] + [Area("cms-kit")] + [Route("api/cms-kit-admin/comments")] + public class CommentAdminController : CmsKitAdminController, ICommentAdminAppService + { + protected ICommentAdminAppService CommentAdminAppService { get; } + + public CommentAdminController(ICommentAdminAppService commentAdminAppService) + { + CommentAdminAppService = commentAdminAppService; + } + + [HttpGet] + public virtual Task> GetListAsync(CommentGetListInput input) + { + return CommentAdminAppService.GetListAsync(input); + } + + [HttpGet] + [Route("{id}")] + public virtual Task GetAsync(Guid id) + { + return CommentAdminAppService.GetAsync(id); + } + + [HttpDelete] + [Route("{id}")] + [Authorize(CmsKitAdminPermissions.Comments.Delete)] + public virtual Task DeleteAsync(Guid id) + { + return CommentAdminAppService.DeleteAsync(id); + } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs index a3b438e341..4267f635b0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs @@ -1,4 +1,5 @@ using System; +using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -57,7 +58,7 @@ namespace Volo.CmsKit.Admin.MediaDescriptors var mediaDescriptorDto = await MediaDescriptorAdminAppService.CreateAsync(inputStream); - return StatusCode(201, mediaDescriptorDto); + return StatusCode((int)HttpStatusCode.Created, mediaDescriptorDto); } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/BlogFeatureDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/BlogFeatureDto.cs new file mode 100644 index 0000000000..aed9d4ddcb --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/BlogFeatureDto.cs @@ -0,0 +1,11 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeatureDto : EntityDto + { + public string FeatureName { get; set; } + public bool IsEnabled { get; set; } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/IBlogFeatureAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/IBlogFeatureAppService.cs new file mode 100644 index 0000000000..968a820ae9 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/IBlogFeatureAppService.cs @@ -0,0 +1,10 @@ +using System; +using System.Threading.Tasks; + +namespace Volo.CmsKit.Blogs +{ + public interface IBlogFeatureAppService + { + Task GetOrDefaultAsync(Guid blogId, string featureName); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/IBlogFeatureCacheManager.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/IBlogFeatureCacheManager.cs new file mode 100644 index 0000000000..9134b67a06 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Blogs/IBlogFeatureCacheManager.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Volo.CmsKit.Blogs +{ + public interface IBlogFeatureCacheManager + { + Task AddOrGetAsync(Guid blogId, string featureName, Func> factory); + Task ClearAsync(Guid blogId, string featureName); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj index f6ab737d8e..1d7baff506 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj @@ -1,18 +1,19 @@ - - + + - - netstandard2.0 - - + + netstandard2.0 + + - - - - - - + + + + + + + diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureAppService.cs new file mode 100644 index 0000000000..a1671b93c9 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureAppService.cs @@ -0,0 +1,41 @@ +using Microsoft.Extensions.Caching.Distributed; +using System; +using System.Threading.Tasks; +using Volo.Abp.Caching; +using Volo.Abp.EventBus.Distributed; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeatureAppService : CmsKitAppServiceBase, IBlogFeatureAppService + { + protected virtual IBlogFeatureRepository BlogFeatureRepository { get; } + + protected virtual IBlogFeatureCacheManager BlogFeatureCacheManager { get; } + + public BlogFeatureAppService( + IBlogFeatureRepository blogFeatureRepository, + IBlogFeatureCacheManager blogFeatureCacheManager) + { + BlogFeatureRepository = blogFeatureRepository; + BlogFeatureCacheManager = blogFeatureCacheManager; + } + + public virtual Task GetOrDefaultAsync(Guid blogId, string featureName) + { + return BlogFeatureCacheManager + .AddOrGetAsync( + blogId, + featureName, + ()=> GetOrDefaultFroRepositoryAsync(blogId, featureName) + ); + } + + protected virtual async Task GetOrDefaultFroRepositoryAsync(Guid blogId, string featureName) + { + var feature = await BlogFeatureRepository.FindAsync(blogId, featureName); + var blogFeature = feature ?? new BlogFeature(blogId, featureName); + + return ObjectMapper.Map(blogFeature); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureCacheManager.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureCacheManager.cs new file mode 100644 index 0000000000..353bc8dad9 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureCacheManager.cs @@ -0,0 +1,46 @@ +using JetBrains.Annotations; +using Microsoft.Extensions.Caching.Distributed; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeatureCacheManager : IBlogFeatureCacheManager, ITransientDependency + { + protected IDistributedCache Cache { get; } + + public BlogFeatureCacheManager(IDistributedCache cache) + { + Cache = cache; + } + + public async Task AddOrGetAsync(Guid blogId, string featureName, Func> factory) + { + return await Cache.GetOrAddAsync( + GetCacheKey(blogId, featureName), + factory, + () => new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(1) + }); + } + + public Task ClearAsync(Guid blogId, string featureName) + { + return Cache.RemoveAsync(GetCacheKey(blogId, featureName)); + } + + private string GetCacheKey(Guid blogId, [NotNull] string featureName) + { + Check.NotNullOrWhiteSpace(featureName, nameof(featureName)); + + return $"{blogId}_{featureName}"; + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureChangedHandler.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureChangedHandler.cs new file mode 100644 index 0000000000..2697b7f2e5 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureChangedHandler.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeatureChangedHandler : IDistributedEventHandler, ITransientDependency + { + protected IDistributedCache Cache { get; } + + public BlogFeatureChangedHandler(IDistributedCache cache) + { + Cache = cache; + } + + public async Task HandleEventAsync(BlogFeatureChangedEto eventData) + { + await Cache.RemoveAsync($"{eventData.BlogId}_{eventData.FeatureName}"); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/MediaDescriptors/MediaDescriptorAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/MediaDescriptors/MediaDescriptorAppService.cs index 81879c5da9..0068390312 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/MediaDescriptors/MediaDescriptorAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/MediaDescriptors/MediaDescriptorAppService.cs @@ -10,8 +10,8 @@ namespace Volo.CmsKit.MediaDescriptors [RequiresGlobalFeature(typeof(MediaFeature))] public class MediaDescriptorAppService : CmsKitAppServiceBase, IMediaDescriptorAppService { - protected readonly IMediaDescriptorRepository MediaDescriptorRepository; - protected readonly IBlobContainer MediaContainer; + protected IMediaDescriptorRepository MediaDescriptorRepository { get; } + protected IBlobContainer MediaContainer { get; } public MediaDescriptorAppService(IMediaDescriptorRepository mediaDescriptorRepository, IBlobContainer mediaContainer) { diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs index caa6dc4181..61dfb15571 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs @@ -9,7 +9,7 @@ namespace Volo.CmsKit.Tags { public class TagAppService : CmsKitAppServiceBase, ITagAppService { - protected readonly ITagRepository TagRepository; + protected ITagRepository TagRepository { get; } public TagAppService(ITagRepository tagRepository) { diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.HttpApi/Volo/CmsKit/Blogs/BlogFeatureController.cs b/modules/cms-kit/src/Volo.CmsKit.Common.HttpApi/Volo/CmsKit/Blogs/BlogFeatureController.cs new file mode 100644 index 0000000000..441562e66d --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.HttpApi/Volo/CmsKit/Blogs/BlogFeatureController.cs @@ -0,0 +1,31 @@ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Blogs; +using Volo.CmsKit.GlobalFeatures; + +namespace Volo.CmsKit.Blogs +{ + [RequiresGlobalFeature(typeof(BlogsFeature))] + [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] + [Area("cms-kit")] + [Route("api/cms-kit/blogs/{blogId}/features")] + public class BlogFeatureController : CmsKitControllerBase, IBlogFeatureAppService + { + protected IBlogFeatureAppService BlogFeatureAppService { get; } + + public BlogFeatureController(IBlogFeatureAppService blogFeatureAppService) + { + BlogFeatureAppService = blogFeatureAppService; + } + + [HttpGet] + [Route("{featureName}")] + public Task GetOrDefaultAsync(Guid blogId, string featureName) + { + return BlogFeatureAppService.GetOrDefaultAsync(blogId, featureName); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogFeatureChangedEto.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogFeatureChangedEto.cs new file mode 100644 index 0000000000..954c851d04 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogFeatureChangedEto.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.EventBus; + +namespace Volo.CmsKit.Blogs +{ + [EventName("CmsKit.Blogs.BlogFeature.Changed")] + public class BlogFeatureChangedEto + { + public Guid BlogId { get; set; } + public string FeatureName { get; set; } + public bool IsEnabled { get; set; } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogFeatureConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogFeatureConsts.cs new file mode 100644 index 0000000000..b030d97ba5 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogFeatureConsts.cs @@ -0,0 +1,7 @@ +namespace Volo.CmsKit.Blogs +{ + public static class BlogFeatureConsts + { + public const int MaxFeatureNameLenth = 64; + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs index 97b67416cf..7d24f76d09 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs @@ -1,4 +1,6 @@ -namespace Volo.CmsKit.Blogs +using Volo.CmsKit.GlobalFeatures; + +namespace Volo.CmsKit.Blogs { public static class BlogPostConsts { @@ -11,5 +13,13 @@ public static int MaxShortDescriptionLength { get; set; } = 256; public const string EntityType = "BlogPost"; + + public const string CommentsFeatureName = CommentsFeature.Name; + + public const string ReactionsFeatureName = ReactionsFeature.Name; + + public const string RatingsFeatureName = RatingsFeature.Name; + + public const string TagsFeatureName = TagsFeature.Name; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs index 60ed82a671..3251bcb230 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/CmsKitErrorCodes.cs @@ -12,7 +12,7 @@ public static class Pages { - public const string UrlAlreadyExist = "CmsKit:Page:0001"; + public const string SlugAlreadyExist = "CmsKit:Page:0001"; } public static class Blogs 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 7b7dd69308..45e2e56a9b 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 @@ -3,7 +3,8 @@ "texts": { "CmsKit:0002": "Content already exists!", "CmsKit:0003": "The entity {0} is not taggable.", - "CmsKit:BlogPost:0001": "Same url slug already exists!", + "CmsKit:BlogPost:0001": "The given slug already exists!", + "CmsKit:Media:0001": "'{Name}' is not a valid media name.", "CmsKit:Page:0001": "The given url ({0}) already exists.", "CmsKit:Tag:0002": "The entity is not taggable!", "CommentAuthorizationExceptionMessage": "Those comments are not allowed for public display.", @@ -16,11 +17,17 @@ "LoginToReply": "Login to reply", "Menu:CMS": "CMS", "MessageDeletionConfirmationMessage": "This comment will be deleted completely.", + "Permission:BlogManagement.Features": "Features", "Permission:CmsKit": "CmsKit", + "Permission:Comments": "Comment Management", + "Permission:Comments.Delete": "Delete", "Permission:Contents": "Content Management", "Permission:Contents.Create": "Create Content", "Permission:Contents.Delete": "Delete Content", "Permission:Contents.Update": "Update Content", + "Permission:MediaDescriptorManagement": "Media Management", + "Permission:MediaDescriptorManagement:Create": "Create", + "Permission:MediaDescriptorManagement:Delete": "Delete", "Permission:PageManagement": "Page Management", "Permission:PageManagement:Create": "Create", "Permission:PageManagement:Delete": "Delete", @@ -40,10 +47,6 @@ "Undo": "Undo", "Update": "Update", "YourComment": "Your comment", - "YourReply": "Your reply", - "CmsKit:Media:0001": "'{Name}' is not a valid media name.", - "Permission:MediaDescriptorManagement": "Media Management", - "Permission:MediaDescriptorManagement:Create": "Create", - "Permission:MediaDescriptorManagement:Delete": "Delete" + "YourReply": "Your reply" } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json index 7d77c0649b..af032d5480 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json @@ -16,6 +16,7 @@ "LoginToReply": "Cevap vermek için giriş yap", "Menu:CMS": "CMS", "MessageDeletionConfirmationMessage": "Bu yorum tamamen silinecektir", + "Permission:BlogManagement.Features": "Özellikler", "Permission:CmsKit": "CmsKit", "Permission:Contents": "İçerik Yönetimi", "Permission:Contents.Create": "İçerik Oluşturma", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs index dcafb6a466..75455b831b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs @@ -4,7 +4,7 @@ { public static int MaxTitleLength { get; set; } = 256; - public static int MaxUrlLength { get; set; } = 256; + public static int MaxSlugLength { get; set; } = 256; public static int MaxDescriptionLength { get; set; } = 512; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Blog.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Blog.cs index 79c496970c..832ed4385e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Blog.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Blog.cs @@ -20,18 +20,20 @@ namespace Volo.CmsKit.Blogs TenantId = tenantId; } - public string Name { get; protected set; } + [NotNull] + public virtual string Name { get; protected set; } - public string Slug { get; protected set; } + [NotNull] + public virtual string Slug { get; protected set; } - public Guid? TenantId { get; protected set; } + public virtual Guid? TenantId { get; protected set; } - public void SetName(string name) + public virtual void SetName(string name) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), maxLength: BlogConsts.MaxNameLength); } - public void SetSlug(string slug) + public virtual void SetSlug(string slug) { Check.NotNullOrWhiteSpace(slug, nameof(slug), maxLength: BlogConsts.MaxNameLength); diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeature.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeature.cs new file mode 100644 index 0000000000..8ec02a1875 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeature.cs @@ -0,0 +1,28 @@ +using JetBrains.Annotations; +using System; +using Volo.Abp; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeature : FullAuditedAggregateRoot, IEquatable + { + public Guid BlogId { get; protected set; } + + public string FeatureName { get; protected set; } + + public bool IsEnabled { get; set; } = true; + + public BlogFeature(Guid blogId, [NotNull] string featureName, bool isEnabled = true) + { + BlogId = blogId; + FeatureName = Check.NotNullOrWhiteSpace(featureName, nameof(featureName)); + IsEnabled = isEnabled; + } + + public bool Equals(BlogFeature other) + { + return BlogId == other?.BlogId && FeatureName == other?.FeatureName; + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs new file mode 100644 index 0000000000..baeca63485 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Domain.Services; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Uow; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeatureManager : DomainService, IBlogFeatureManager + { + protected IBlogFeatureRepository BlogFeatureRepository { get; } + + protected IDefaultBlogFeatureProvider DefaultBlogFeatureProvider { get; } + + protected IUnitOfWorkManager UnitOfWorkManager { get; } + + protected IDistributedEventBus EventBus { get; } + + public BlogFeatureManager( + IBlogFeatureRepository blogFeatureRepository, + IDefaultBlogFeatureProvider defaultBlogFeatureProvider, + IUnitOfWorkManager unitOfWorkManager, + IDistributedEventBus eventBus) + { + BlogFeatureRepository = blogFeatureRepository; + DefaultBlogFeatureProvider = defaultBlogFeatureProvider; + UnitOfWorkManager = unitOfWorkManager; + EventBus = eventBus; + } + + public async Task> GetListAsync(Guid blogId) + { + var blogFeatures = await BlogFeatureRepository.GetListAsync(blogId); + + var defaultFeatures = await DefaultBlogFeatureProvider.GetDefaultFeaturesAsync(blogId); + + defaultFeatures.ForEach(x => blogFeatures.AddIfNotContains(x)); + + return blogFeatures; + } + + public async Task SetAsync(Guid blogId, string featureName, bool isEnabled) + { + var blogFeature = await BlogFeatureRepository.FindAsync(blogId, featureName); + if (blogFeature == null) + { + var newBlogFeature = new BlogFeature(blogId, featureName, isEnabled); + await BlogFeatureRepository.InsertAsync(newBlogFeature); + } + else + { + blogFeature.IsEnabled = isEnabled; + await BlogFeatureRepository.UpdateAsync(blogFeature); + } + + await UnitOfWorkManager.Current.SaveChangesAsync(); + + await EventBus.PublishAsync(new BlogFeatureChangedEto + { + BlogId = blogId, + FeatureName = featureName, + IsEnabled = isEnabled + }); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs index 7a52fe0d9f..2e4949cd84 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs @@ -1,10 +1,8 @@ using JetBrains.Annotations; using System; -using System.Text.RegularExpressions; using Volo.Abp; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -using Volo.CmsKit.Blogs; using Volo.CmsKit.Blogs.Extensions; using Volo.CmsKit.Users; @@ -12,15 +10,18 @@ namespace Volo.CmsKit.Blogs { public class BlogPost : FullAuditedAggregateRootWithUser, IMultiTenant { - public Guid BlogId { get; protected set; } + public virtual Guid BlogId { get; protected set; } - public string Title { get; protected set; } + [NotNull] + public virtual string Title { get; protected set; } - public string Slug { get; protected set; } + [NotNull] + public virtual string Slug { get; protected set; } - public string ShortDescription { get; protected set; } + [NotNull] + public virtual string ShortDescription { get; protected set; } - public Guid? TenantId { get; protected set; } + public virtual Guid? TenantId { get; protected set; } protected BlogPost() { @@ -39,7 +40,7 @@ namespace Volo.CmsKit.Blogs ShortDescription = shortDescription; } - public void SetTitle(string title) + public virtual void SetTitle(string title) { Title = Check.NotNullOrWhiteSpace(title, nameof(title), BlogPostConsts.MaxTitleLength); } @@ -51,7 +52,7 @@ namespace Volo.CmsKit.Blogs Slug = slug.NormalizeSlug(); } - public void SetShortDescription(string shortDescription) + public virtual void SetShortDescription(string shortDescription) { ShortDescription = Check.Length(shortDescription, nameof(shortDescription), BlogPostConsts.MaxShortDescriptionLength); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs index aed2b9fffd..7ba85f8ce6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs @@ -1,8 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using JetBrains.Annotations; +using System; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Services; @@ -10,35 +9,37 @@ namespace Volo.CmsKit.Blogs { public class BlogPostManager : DomainService, IBlogPostManager { - protected readonly IBlogPostRepository blogPostRepository; - protected readonly IBlogRepository blogRepository; + protected IBlogPostRepository BlogPostRepository { get; } + protected IBlogRepository BlogRepository { get; } public BlogPostManager( IBlogPostRepository blogPostRepository, IBlogRepository blogRepository) { - this.blogPostRepository = blogPostRepository; - this.blogRepository = blogRepository; + BlogPostRepository = blogPostRepository; + BlogRepository = blogRepository; } - public async Task CreateAsync(BlogPost blogPost) + public virtual async Task CreateAsync(BlogPost blogPost) { await CheckBlogExistenceAsync(blogPost.BlogId); await CheckSlugExistenceAsync(blogPost.BlogId, blogPost.Slug); - return await blogPostRepository.InsertAsync(blogPost); + return await BlogPostRepository.InsertAsync(blogPost); } - public async Task UpdateAsync(BlogPost blogPost) + public virtual async Task UpdateAsync(BlogPost blogPost) { await CheckBlogExistenceAsync(blogPost.BlogId); - await blogPostRepository.UpdateAsync(blogPost); + await BlogPostRepository.UpdateAsync(blogPost); } - public async Task SetSlugUrlAsync(BlogPost blogPost, string newSlug) + public virtual async Task SetSlugUrlAsync(BlogPost blogPost, [NotNull] string newSlug) { + Check.NotNullOrWhiteSpace(newSlug, nameof(newSlug)); + await CheckSlugExistenceAsync(blogPost.BlogId, newSlug); blogPost.SetSlug(newSlug); @@ -46,7 +47,7 @@ namespace Volo.CmsKit.Blogs private async Task CheckSlugExistenceAsync(Guid blogId, string slug) { - if (await blogPostRepository.SlugExistsAsync(blogId, slug)) + if (await BlogPostRepository.SlugExistsAsync(blogId, slug)) { throw new BlogPostSlugAlreadyExistException(blogId, slug); } @@ -54,7 +55,7 @@ namespace Volo.CmsKit.Blogs private async Task CheckBlogExistenceAsync(Guid blogId) { - if (!await blogRepository.ExistsAsync(blogId)) + if (!await BlogRepository.ExistsAsync(blogId)) throw new EntityNotFoundException(typeof(Blog), blogId); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostSlugAlreadyExistException.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostSlugAlreadyExistException.cs index 8e59249299..034cb8e60d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostSlugAlreadyExistException.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostSlugAlreadyExistException.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.Serialization; using Volo.Abp; namespace Volo.CmsKit.Blogs @@ -9,7 +10,7 @@ namespace Volo.CmsKit.Blogs { } - internal BlogPostSlugAlreadyExistException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context) : base(serializationInfo, context) + internal BlogPostSlugAlreadyExistException(SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context) : base(serializationInfo, context) { } @@ -24,8 +25,8 @@ namespace Volo.CmsKit.Blogs WithData(nameof(BlogId), BlogId); } - public string Slug { get; } + public virtual string Slug { get; } - public Guid BlogId { get; } + public virtual Guid BlogId { get; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/DefaultBlogFeatureProvider.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/DefaultBlogFeatureProvider.cs new file mode 100644 index 0000000000..b72ea6bd72 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/DefaultBlogFeatureProvider.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.CmsKit.Blogs +{ + public class DefaultBlogFeatureProvider : IDefaultBlogFeatureProvider, ITransientDependency + { + public virtual Task> GetDefaultFeaturesAsync(Guid blogId) + { + return Task.FromResult(new List + { + new BlogFeature(blogId, BlogPostConsts.CommentsFeatureName), + new BlogFeature(blogId, BlogPostConsts.ReactionsFeatureName), + new BlogFeature(blogId, BlogPostConsts.RatingsFeatureName), + new BlogFeature(blogId, BlogPostConsts.TagsFeatureName), + }); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Extensions/SlugExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Extensions/SlugExtensions.cs index 9b3908d8cb..a625d4687f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Extensions/SlugExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/Extensions/SlugExtensions.cs @@ -5,11 +5,10 @@ namespace Volo.CmsKit.Blogs.Extensions { public static class SlugExtensions { + static readonly SlugHelper SlugHelper = new (); public static string NormalizeSlug(this string value) { - var slugHelper = new SlugHelper(); - - return slugHelper.GenerateSlug(value?.Unidecode()); + return SlugHelper.GenerateSlug(value?.Unidecode()); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureManager.cs new file mode 100644 index 0000000000..74ffefafd4 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureManager.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Domain.Services; +using Volo.CmsKit.Blogs; + +namespace Volo.CmsKit.Blogs +{ + public interface IBlogFeatureManager : IDomainService + { + Task> GetListAsync(Guid blogId); + + Task SetAsync(Guid blogId, string featureName, bool isEnabled); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureRepository.cs new file mode 100644 index 0000000000..7f66f222db --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureRepository.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; + +namespace Volo.CmsKit.Blogs +{ + public interface IBlogFeatureRepository : IBasicRepository + { + Task> GetListAsync(Guid blogId); + + Task> GetListAsync(Guid blogId, List featureNames); + + Task FindAsync(Guid blogId, string featureName); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostManager.cs index 5027fa8e38..9a3afebf71 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostManager.cs @@ -1,4 +1,4 @@ -using System; +using JetBrains.Annotations; using System.Threading.Tasks; namespace Volo.CmsKit.Blogs @@ -9,6 +9,6 @@ namespace Volo.CmsKit.Blogs Task UpdateAsync(BlogPost blogPost); - Task SetSlugUrlAsync(BlogPost blogPost, string newSlug); + Task SetSlugUrlAsync(BlogPost blogPost, [NotNull] string newSlug); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs index 198cfca104..943ea381f3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogRepository.cs index 4213884057..2feb057111 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogRepository.cs @@ -1,4 +1,5 @@ using System; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -6,7 +7,7 @@ namespace Volo.CmsKit.Blogs { public interface IBlogRepository : IBasicRepository { - public Task GetBySlugAsync(string slug); - Task ExistsAsync(Guid blogId); + public Task GetBySlugAsync(string slug, CancellationToken cancellationToken = default); + Task ExistsAsync(Guid blogId, CancellationToken cancellationToken = default); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IDefaultBlogFeatureProvider.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IDefaultBlogFeatureProvider.cs new file mode 100644 index 0000000000..51234e3cbd --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IDefaultBlogFeatureProvider.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.CmsKit.Blogs; + +namespace Volo.CmsKit.Blogs +{ + public interface IDefaultBlogFeatureProvider + { + Task> GetDefaultFeaturesAsync(Guid blogId); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs index 0c61a22f02..234b866183 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs @@ -9,6 +9,33 @@ namespace Volo.CmsKit.Comments { public interface ICommentRepository : IBasicRepository { + Task GetWithAuthorAsync(Guid id, CancellationToken cancellationToken = default); + + Task> GetListAsync( + string filter = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + string sorting = null, + int maxResultCount = int.MaxValue, + int skipCount = 0, + CancellationToken cancellationToken = default + ); + + Task GetCountAsync( + string text = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + CancellationToken cancellationToken = default + ); + Task> GetListWithAuthorsAsync( [NotNull] string entityType, [NotNull] string entityId, diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs index e2d4a2a4ac..392abfbc6f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs @@ -8,31 +8,37 @@ namespace Volo.CmsKit.Contents { public class Content : FullAuditedAggregateRoot, IMultiTenant { - public virtual Guid? TenantId { get; protected set; } - - public virtual string EntityType { get; protected set; } - - public virtual string EntityId { get; set; } - - public virtual string Value { get; protected set; } + [CanBeNull] public virtual Guid? TenantId { get; protected set; } + + [NotNull] public virtual string EntityType { get; protected set; } + + [NotNull] public virtual string EntityId { get; protected set; } + + [NotNull] public virtual string Value { get; protected set; } protected Content() { - } - - public Content(Guid id, [NotNull] string entityType, [NotNull] string entityId, [NotNull] string value, Guid? tenantId = null) : base(id) + + public Content(Guid id, [NotNull] string entityType, [NotNull] string entityId, [NotNull] string value, + Guid? tenantId = null) : base(id) { - EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength); EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength); - SetValue(value); - + EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength); + Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength); + TenantId = tenantId; } - public void SetValue([NotNull] string value) + public virtual void SetValue([NotNull] string value) { - Value = Check.NotNullOrWhiteSpace(value, nameof(value), ContentConsts.MaxValueLength); + Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength); + } + + public virtual void SetEntity([NotNull] string entityType, [NotNull] string entityId) + { + EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength); + EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/TagAlreadyExistException.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentAlreadyExistException.cs similarity index 100% rename from modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/TagAlreadyExistException.cs rename to modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentAlreadyExistException.cs diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs index 047d923ad6..707f15bbb9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs @@ -18,14 +18,15 @@ namespace Volo.CmsKit.Contents ContentRepository = contentRepository; } - public async Task InsertAsync(Content content, CancellationToken cancellationToken = default) + public virtual async Task InsertAsync(Content content, CancellationToken cancellationToken = default) { - if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId, cancellationToken)) + if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId, + cancellationToken)) { throw new ContentAlreadyExistException(content.EntityType, content.EntityId); } - return await ContentRepository.InsertAsync(content); + return await ContentRepository.InsertAsync(content, cancellationToken: cancellationToken); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/IPageRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/IPageRepository.cs index 931618f774..b5ed3f0639 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/IPageRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/IPageRepository.cs @@ -17,10 +17,10 @@ namespace Volo.CmsKit.Pages string sorting = null, CancellationToken cancellationToken = default); - Task GetByUrlAsync(string url, CancellationToken cancellationToken = default); + Task GetBySlugAsync(string slug, CancellationToken cancellationToken = default); - Task FindByUrlAsync(string url, CancellationToken cancellationToken = default); + Task FindBySlugAsync(string slug, CancellationToken cancellationToken = default); - Task ExistsAsync(string url, CancellationToken cancellationToken = default); + Task ExistsAsync(string slug, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs index 240fc629d6..cae13a5254 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs @@ -8,26 +8,36 @@ namespace Volo.CmsKit.Pages { public class Page : FullAuditedAggregateRoot, IMultiTenant { - public Guid? TenantId { get; set; } + [CanBeNull] public virtual Guid? TenantId { get; protected set; } - public virtual string Title { get; set; } + [NotNull] public virtual string Title { get; protected set; } + + [NotNull] public virtual string Slug { get; protected set; } + + [CanBeNull] public virtual string Description { get; set; } - public virtual string Url { get; set; } - - public virtual string Description { get; set; } - protected Page() { - } - public Page(Guid id, [NotNull] string title, [NotNull] string url, [CanBeNull] string description = null, Guid? tenantId = null) : base(id) + public Page(Guid id, [NotNull] string title, [NotNull] string slug, [CanBeNull] string description = null, + Guid? tenantId = null) : base(id) { - Title = Check.NotNullOrWhiteSpace(title, nameof(title), PageConsts.MaxTitleLength); - Url = Check.NotNullOrWhiteSpace(url, nameof(url), PageConsts.MaxUrlLength); + Title = Check.NotNullOrEmpty(title, nameof(title), PageConsts.MaxTitleLength); + Slug = Check.NotNullOrEmpty(slug, nameof(slug), PageConsts.MaxSlugLength); Description = Check.Length(description, nameof(description), PageConsts.MaxDescriptionLength); - + TenantId = tenantId; } + + public virtual void SetTitle(string title) + { + Title = Check.NotNullOrEmpty(title, nameof(title), PageConsts.MaxTitleLength); + } + + public virtual void SetSlug(string slug) + { + Slug = Check.NotNullOrEmpty(slug, nameof(slug), PageConsts.MaxSlugLength); + } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageSlugAlreadyExistsException.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageSlugAlreadyExistsException.cs new file mode 100644 index 0000000000..9970c67b6f --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageSlugAlreadyExistsException.cs @@ -0,0 +1,23 @@ +using System; +using System.Runtime.Serialization; +using JetBrains.Annotations; +using Volo.Abp; + +namespace Volo.CmsKit.Pages +{ + [Serializable] + public class PageSlugAlreadyExistsException : BusinessException + { + public PageSlugAlreadyExistsException([NotNull] string slug) + { + Code = CmsKitErrorCodes.Pages.SlugAlreadyExist; + WithData(nameof(Page.Slug), slug); + } + + public PageSlugAlreadyExistsException(SerializationInfo serializationInfo, StreamingContext context) + : base(serializationInfo, context) + { + + } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs deleted file mode 100644 index 142d03c441..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/PageUrlAlreadyExistException.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Runtime.Serialization; -using JetBrains.Annotations; -using Volo.Abp; - -namespace Volo.CmsKit.Pages -{ - [Serializable] - public class PageUrlAlreadyExistException : BusinessException - { - public PageUrlAlreadyExistException([NotNull] string url) - { - Code = CmsKitErrorCodes.Pages.UrlAlreadyExist; - WithData(nameof(Page.Url), url); - } - - public PageUrlAlreadyExistException(SerializationInfo serializationInfo, StreamingContext context) - : base(serializationInfo, context) - { - - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/CmsKitTagOptions.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/CmsKitTagOptions.cs index 8f9b073d6b..e6530c887a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/CmsKitTagOptions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/CmsKitTagOptions.cs @@ -1,5 +1,4 @@ using JetBrains.Annotations; -using Volo.CmsKit.Tags; namespace Volo.CmsKit.Tags { diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/DefaultTagDefinitionStore.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/DefaultTagDefinitionStore.cs index 5a79bea25a..1787b2b949 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/DefaultTagDefinitionStore.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/DefaultTagDefinitionStore.cs @@ -11,11 +11,11 @@ namespace Volo.CmsKit.Tags { public class DefaultTagDefinitionStore : ITagDefinitionStore, ITransientDependency { - private readonly CmsKitTagOptions options; + protected CmsKitTagOptions CmsKitTagOptions { get; } public DefaultTagDefinitionStore(IOptions options) { - this.options = options.Value; + CmsKitTagOptions = options.Value; } /// @@ -28,7 +28,8 @@ namespace Volo.CmsKit.Tags { Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); - var result = options.EntityTypes.SingleOrDefault(x => x.EntityType == entityType) ?? throw new EntityNotTaggableException(entityType); + var result = CmsKitTagOptions.EntityTypes.SingleOrDefault(x => x.EntityType == entityType) ?? + throw new EntityNotTaggableException(entityType); return Task.FromResult(result); } @@ -38,7 +39,7 @@ namespace Volo.CmsKit.Tags /// public virtual Task> GetTagEntityTypeDefinitionListAsync() { - return Task.FromResult(options.EntityTypes.ToList()); + return Task.FromResult(CmsKitTagOptions.EntityTypes.ToList()); } /// @@ -50,9 +51,9 @@ namespace Volo.CmsKit.Tags { Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); - var definition = options.EntityTypes.SingleOrDefault(x => x.EntityType == entityType); + var isDefined = CmsKitTagOptions.EntityTypes.Any(x => x.EntityType == entityType); - return Task.FromResult(definition != null); + return Task.FromResult(isDefined); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTag.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTag.cs index c49a9661ef..793bf31d86 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTag.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTag.cs @@ -1,4 +1,6 @@ using System; +using JetBrains.Annotations; +using Volo.Abp; using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; @@ -16,10 +18,10 @@ namespace Volo.CmsKit.Tags { } - internal EntityTag(Guid tagId, string entityId, Guid? tenantId = null) + internal EntityTag(Guid tagId, [NotNull] string entityId, Guid? tenantId = null) { TagId = tagId; - EntityId = entityId; + EntityId = Check.NotNullOrEmpty(entityId,nameof(entityId)); TenantId = tenantId; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs index 0de6328775..ad7a3088d5 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs @@ -3,50 +3,47 @@ using System; using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Services; -using Volo.CmsKit.Tags; namespace Volo.CmsKit.Tags { public class EntityTagManager : DomainService, IEntityTagManager { - protected readonly IEntityTagRepository _entityTagRepository; - protected readonly ITagDefinitionStore _tagDefinitionStore; + protected IEntityTagRepository EntityTagRepository { get; } + protected ITagDefinitionStore TagDefinitionStore { get; } public EntityTagManager( IEntityTagRepository entityTagRepository, ITagDefinitionStore tagDefinitionStore) { - _entityTagRepository = entityTagRepository; - _tagDefinitionStore = tagDefinitionStore; + EntityTagRepository = entityTagRepository; + TagDefinitionStore = tagDefinitionStore; } - public async Task AddTagToEntityAsync( + public virtual async Task AddTagToEntityAsync( [NotNull] Guid tagId, [NotNull] string entityType, [NotNull] string entityId, [CanBeNull] Guid? tenantId = null, CancellationToken cancellationToken = default) { - if (!await _tagDefinitionStore.IsDefinedAsync(entityType)) + if (!await TagDefinitionStore.IsDefinedAsync(entityType)) { throw new EntityNotTaggableException(entityType); } var entityTag = new EntityTag(tagId, entityId, tenantId); - - return await _entityTagRepository.InsertAsync(entityTag, cancellationToken: cancellationToken); + return await EntityTagRepository.InsertAsync(entityTag, cancellationToken: cancellationToken); } - public async Task RemoveTagFromEntityAsync( + public virtual async Task RemoveTagFromEntityAsync( [NotNull] Guid tagId, [NotNull] string entityType, [NotNull] string entityId, [CanBeNull] Guid? tenantId = null, CancellationToken cancellationToken = default) { - var entityTag = await _entityTagRepository.FindAsync(tagId, entityId, tenantId, cancellationToken); - - await _entityTagRepository.DeleteAsync(entityTag); + var entityTag = await EntityTagRepository.FindAsync(tagId, entityId, tenantId, cancellationToken); + await EntityTagRepository.DeleteAsync(entityTag, cancellationToken: cancellationToken); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs index fab09ed521..4b9aeebde1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs @@ -8,11 +8,13 @@ namespace Volo.CmsKit.Tags { public class Tag : FullAuditedAggregateRoot, IMultiTenant { - public string EntityType { get; set; } + public virtual Guid? TenantId { get; protected set; } - public string Name { get; protected set; } - - public Guid? TenantId { get; set; } + [NotNull] + public virtual string EntityType { get; protected set; } + + [NotNull] + public virtual string Name { get; protected set; } protected Tag() { @@ -24,14 +26,19 @@ namespace Volo.CmsKit.Tags [NotNull] string name, Guid? tenantId = null) : base(id) { - EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType), TagConsts.MaxEntityTypeLength); - SetName(name); + EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), TagConsts.MaxEntityTypeLength); + Name = Check.NotNullOrEmpty(name, nameof(name), TagConsts.MaxNameLength); TenantId = tenantId; } - public void SetName(string name) + public virtual void SetName([NotNull] string name) + { + Name = Check.NotNullOrEmpty(name, nameof(name), TagConsts.MaxNameLength); + } + + public virtual void SetEntityType(string entityType) { - Name = Check.NotNullOrWhiteSpace(name, nameof(name), TagConsts.MaxNameLength); + EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), TagConsts.MaxEntityTypeLength); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagEntityTypeDefiniton.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagEntityTypeDefiniton.cs index 463c78d4a4..4be00e4ac9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagEntityTypeDefiniton.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagEntityTypeDefiniton.cs @@ -25,13 +25,12 @@ namespace Volo.CmsKit.Tags [CanBeNull] string deletePolicy = null) : base(createPolicy, updatePolicy, deletePolicy) { EntityType = Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); - DisplayName = displayName; } public bool Equals(TagEntityTypeDefiniton other) { - return EntityType == other.EntityType; + return EntityType == other?.EntityType; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagManager.cs index 77d50e9949..94a3784bcd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/TagManager.cs @@ -1,35 +1,27 @@ using JetBrains.Annotations; -using Microsoft.Extensions.Options; using System; using System.Collections.Generic; -using System.Linq; using System.Threading; using System.Threading.Tasks; -using Volo.Abp; using Volo.Abp.Domain.Services; namespace Volo.CmsKit.Tags { public class TagManager : DomainService, ITagManager { - private readonly ITagRepository _tagRepository; - private readonly ITagDefinitionStore _tagDefinitionStore; + protected ITagRepository TagRepository { get; } + protected ITagDefinitionStore TagDefinitionStore { get; } - public TagManager( - ITagRepository tagRepository, - ITagDefinitionStore tagDefinitionStore) + public TagManager(ITagRepository tagRepository, ITagDefinitionStore tagDefinitionStore) { - _tagRepository = tagRepository; - _tagDefinitionStore = tagDefinitionStore; + TagRepository = tagRepository; + TagDefinitionStore = tagDefinitionStore; } - public async Task GetOrAddAsync( - [NotNull] string entityType, - [NotNull] string name, - Guid? tenantId = null, - CancellationToken cancellationToken = default) + public virtual async Task GetOrAddAsync([NotNull] string entityType, [NotNull] string name, + Guid? tenantId = null, CancellationToken cancellationToken = default) { - var entity = await _tagRepository.FindAsync(entityType, name, tenantId, cancellationToken); + var entity = await TagRepository.FindAsync(entityType, name, tenantId, cancellationToken); if (entity == null) { @@ -39,53 +31,43 @@ namespace Volo.CmsKit.Tags return entity; } - public async Task InsertAsync( - Guid id, - [NotNull] string entityType, - [NotNull] string name, - Guid? tenantId = null, - CancellationToken cancellationToken = default) + public virtual async Task InsertAsync(Guid id, [NotNull] string entityType, [NotNull] string name, + Guid? tenantId = null, CancellationToken cancellationToken = default) { - if (await _tagRepository.AnyAsync(entityType, name, tenantId, cancellationToken)) + if (!await TagDefinitionStore.IsDefinedAsync(entityType)) { - throw new TagAlreadyExistException(entityType, name); + throw new EntityNotTaggableException(entityType); } - if (!await _tagDefinitionStore.IsDefinedAsync(entityType)) + if (await TagRepository.AnyAsync(entityType, name, tenantId, cancellationToken)) { - throw new EntityNotTaggableException(entityType); + throw new TagAlreadyExistException(entityType, name); } - return await _tagRepository.InsertAsync( - new Tag( - id, - entityType, - name, - tenantId), + return await TagRepository.InsertAsync(new Tag(id, entityType, name, tenantId), cancellationToken: cancellationToken); } - public async Task UpdateAsync( - Guid id, - [NotNull] string name, + public virtual async Task UpdateAsync(Guid id, [NotNull] string name, CancellationToken cancellationToken = default) { - var entity = await _tagRepository.GetAsync(id, cancellationToken: cancellationToken); + var entity = await TagRepository.GetAsync(id, cancellationToken: cancellationToken); if (name != entity.Name && - await _tagRepository.AnyAsync(entity.EntityType, name, entity.TenantId, cancellationToken)) + await TagRepository.AnyAsync(entity.EntityType, name, entity.TenantId, cancellationToken)) { throw new TagAlreadyExistException(entity.EntityType, name); } entity.SetName(name); - return await _tagRepository.UpdateAsync(entity, cancellationToken: cancellationToken); + return await TagRepository.UpdateAsync(entity, cancellationToken: cancellationToken); } - public Task> GetTagDefinitionsAsync(CancellationToken cancellationToken = default) + public virtual Task> GetTagDefinitionsAsync( + CancellationToken cancellationToken = default) { - return _tagDefinitionStore.GetTagEntityTypeDefinitionListAsync(); + return TagDefinitionStore.GetTagEntityTypeDefinitionListAsync(); } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs new file mode 100644 index 0000000000..c5fe9d658f --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.CmsKit.EntityFrameworkCore; + +namespace Volo.CmsKit.Blogs +{ + public class EfCoreBlogFeatureRepository : EfCoreRepository, IBlogFeatureRepository + { + public EfCoreBlogFeatureRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public Task FindAsync(Guid blogId, string featureName) + { + return base.FindAsync(x => x.BlogId == blogId && x.FeatureName == featureName); + } + + public async Task> GetListAsync(Guid blogId) + { + return await (await GetQueryableAsync()) + .Where(x => x.BlogId == blogId) + .ToListAsync(); + } + + public async Task> GetListAsync(Guid blogId, List featureNames) + { + return await (await GetQueryableAsync()) + .Where(x => x.BlogId == blogId && featureNames.Contains(x.FeatureName)) + .ToListAsync(); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs index 5a9c5d526a..b914b4ad01 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs @@ -10,6 +10,8 @@ using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore; using System.Linq; using System.Data.Common; +using JetBrains.Annotations; +using Volo.Abp; using Volo.Abp.Domain.Entities; namespace Volo.CmsKit.Blogs @@ -20,30 +22,30 @@ namespace Volo.CmsKit.Blogs { } - public async Task GetBySlugAsync(Guid blogId, string slug, CancellationToken cancellationToken = default) + public async Task GetBySlugAsync(Guid blogId, [NotNull] string slug, + CancellationToken cancellationToken = default) { - var dbSet = await GetDbSetAsync(); + Check.NotNullOrEmpty(slug, nameof(slug)); - return await dbSet - .Include(i=> i.Creator) - .Where(x => - x.BlogId == blogId && x.Slug.ToLower() == slug) - .FirstOrDefaultAsync(cancellationToken: cancellationToken) - ?? throw new EntityNotFoundException(typeof(BlogPost)); + return await (await WithDetailsAsync()) + .Where(x => + x.BlogId == blogId && x.Slug.ToLower() == slug) + .FirstOrDefaultAsync(cancellationToken: GetCancellationToken(cancellationToken)) + ?? throw new EntityNotFoundException(typeof(BlogPost)); } public async Task GetCountAsync(Guid blogId, CancellationToken cancellationToken = default) { return await (await GetQueryableAsync()).CountAsync( - x => x.BlogId == blogId, - cancellationToken); + x => x.BlogId == blogId, + GetCancellationToken(cancellationToken)); } - public async Task> GetPagedListAsync(Guid blogId, int skipCount, int maxResultCount, string sorting, bool includeDetails = false, CancellationToken cancellationToken = default) + public async Task> GetPagedListAsync(Guid blogId, int skipCount, int maxResultCount, + string sorting, bool includeDetails = false, CancellationToken cancellationToken = default) { - var queryable = (await GetQueryableAsync()) - .Include(i => i.Creator) - .Where(x => x.BlogId == blogId); + var queryable = (await WithDetailsAsync()) + .Where(x => x.BlogId == blogId); if (!sorting.IsNullOrWhiteSpace()) { @@ -51,16 +53,23 @@ namespace Volo.CmsKit.Blogs } return await queryable - .Skip(skipCount) - .Take(maxResultCount) - .ToListAsync(cancellationToken); + .Skip(skipCount) + .Take(maxResultCount) + .ToListAsync(GetCancellationToken()); } - public async Task SlugExistsAsync(Guid blogId, string slug, CancellationToken cancellationToken = default) + public async Task SlugExistsAsync(Guid blogId, [NotNull] string slug, + CancellationToken cancellationToken = default) { - var dbSet = await GetDbSetAsync(); + Check.NotNullOrEmpty(slug, nameof(slug)); - return await dbSet.AnyAsync(x => x.BlogId == blogId && x.Slug.ToLower() == slug, cancellationToken); + return await (await WithDetailsAsync()).AnyAsync(x => x.BlogId == blogId && x.Slug.ToLower() == slug, + GetCancellationToken(cancellationToken)); + } + + public override async Task> WithDetailsAsync() + { + return (await GetDbSetAsync()).Include(i => i.Creator); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogRepository.cs index d2ddbf35aa..c39dee2685 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogRepository.cs @@ -1,7 +1,10 @@ using Microsoft.EntityFrameworkCore; using System; using System.Security.Cryptography.X509Certificates; +using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; +using Volo.Abp; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore; @@ -14,14 +17,15 @@ namespace Volo.CmsKit.Blogs { } - public async Task ExistsAsync(Guid blogId) + public virtual async Task ExistsAsync(Guid blogId, CancellationToken cancellationToken = default) { - return await (await GetQueryableAsync()).AnyAsync(x => x.Id == blogId); + return await (await GetQueryableAsync()).AnyAsync(x => x.Id == blogId, GetCancellationToken(cancellationToken)); } - public Task GetBySlugAsync(string slug) + public virtual Task GetBySlugAsync([NotNull]string slug, CancellationToken cancellationToken = default) { - return GetAsync(x => x.Slug == slug); + Check.NotNullOrEmpty(slug, nameof(slug)); + return GetAsync(x => x.Slug == slug, cancellationToken: GetCancellationToken(cancellationToken)); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs index 40496aaef8..8ca73426be 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore; @@ -20,6 +22,89 @@ namespace Volo.CmsKit.Comments { } + public async Task GetWithAuthorAsync(Guid id, + CancellationToken cancellationToken = default) + { + var query = from comment in (await GetDbSetAsync()) + join user in (await GetDbContextAsync()).Set() on comment.CreatorId equals user.Id + where id == comment.Id + select new CommentWithAuthorQueryResultItem + { + Comment = comment, + Author = user + }; + + var commentWithAuthor = await query.FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + + if (commentWithAuthor == null) + { + throw new EntityNotFoundException(typeof(Comment), id); + } + + return commentWithAuthor; + } + + public async Task> GetListAsync( + string filter = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + string sorting = null, + int maxResultCount = int.MaxValue, + int skipCount = 0, + CancellationToken cancellationToken = default + ) + { + var token = GetCancellationToken(cancellationToken); + var query = await GetListQueryAsync( + filter, + entityType, + entityId, + repliedCommentId, + authorUsername, + creationStartDate, + creationEndDate, + token); + + if (sorting != null) + { + sorting = "comment." + sorting; + } + + query = query.OrderBy(sorting ?? "comment.creationTime desc") + .PageBy(skipCount, maxResultCount); + + return await query.ToListAsync(token); + } + + public async Task GetCountAsync( + string text = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + CancellationToken cancellationToken = default + ) + { + var token = GetCancellationToken(cancellationToken); + var query = await GetListQueryAsync( + text, + entityType, + entityId, + repliedCommentId, + authorUsername, + creationStartDate, + creationEndDate, + token); + + return await query.LongCountAsync(token); + } + public async Task> GetListWithAuthorsAsync( string entityType, string entityId, @@ -59,5 +144,37 @@ namespace Volo.CmsKit.Comments await DeleteAsync(comment, cancellationToken: GetCancellationToken(cancellationToken)); } + + protected virtual async Task> GetListQueryAsync( + string filter = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + CancellationToken cancellationToken = default + ) + { + var commentDbSet = await GetDbSetAsync(); + var cmsUserSet = (await GetDbContextAsync()).Set(); + + var query = from comment in commentDbSet + join user in cmsUserSet + on comment.CreatorId equals user.Id + select new CommentWithAuthorQueryResultItem + { + Comment = comment, + Author = user + }; + + return query.WhereIf(!filter.IsNullOrWhiteSpace(), c => c.Comment.Text.Contains(filter)) + .WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.Comment.EntityType.Contains(entityType)) + .WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.Comment.EntityId.Contains(entityId)) + .WhereIf(repliedCommentId.HasValue, c => c.Comment.RepliedCommentId == repliedCommentId) + .WhereIf(!authorUsername.IsNullOrWhiteSpace(),c=>c.Author.UserName.Contains(authorUsername)) + .WhereIf(creationStartDate.HasValue, c => c.Comment.CreationTime >= creationStartDate) + .WhereIf(creationEndDate.HasValue, c => c.Comment.CreationTime <= creationEndDate); + } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs index 884c5e9b01..9a99bc5eca 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore; using System; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore; @@ -15,12 +16,15 @@ namespace Volo.CmsKit.Contents { } - public Task GetAsync( + public virtual Task GetAsync( string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return GetAsync(x => x.EntityType == entityType && x.EntityId == entityId && @@ -29,12 +33,15 @@ namespace Volo.CmsKit.Contents ); } - public Task FindAsync( + public virtual Task FindAsync( string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return FindAsync(x => x.EntityType == entityType && x.EntityId == entityId && @@ -43,12 +50,15 @@ namespace Volo.CmsKit.Contents ); } - public Task DeleteAsync( + public virtual Task DeleteAsync( string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return DeleteAsync(x => x.EntityType == entityType && x.EntityId == entityId && @@ -56,12 +66,15 @@ namespace Volo.CmsKit.Contents cancellationToken: GetCancellationToken(cancellationToken)); } - public async Task ExistsAsync( + public virtual async Task ExistsAsync( [NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + var dbSet = await GetDbSetAsync(); return await dbSet.AnyAsync(x => x.EntityType == entityType && diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs index 17a5dc5c34..749a0653f9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs @@ -26,6 +26,7 @@ namespace Volo.CmsKit.EntityFrameworkCore public DbSet Pages { get; set; } public DbSet Blogs { get; set; } public DbSet BlogPosts { get; set; } + public DbSet BlogFeatures { get; set; } public DbSet MediaDescriptors { get; set; } public CmsKitDbContext(DbContextOptions options) 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 9f0ac813fc..390ae37c7e 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 @@ -178,10 +178,10 @@ namespace Volo.CmsKit.EntityFrameworkCore b.ConfigureByConvention(); b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength); - b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); + b.Property(x => x.Slug).IsRequired().HasMaxLength(PageConsts.MaxSlugLength); b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); - b.HasIndex(x => new { x.TenantId, x.Url }); + b.HasIndex(x => new { x.TenantId, Url = x.Slug }); }); } else @@ -216,11 +216,21 @@ namespace Volo.CmsKit.EntityFrameworkCore b.HasIndex(x => new { x.Slug, x.BlogId }); }); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "BlogFeatures", options.Schema); + + b.ConfigureByConvention(); + + b.Property(p => p.FeatureName).IsRequired().HasMaxLength(BlogFeatureConsts.MaxFeatureNameLenth); + }); } else { builder.Ignore(); builder.Ignore(); + builder.Ignore(); } if (GlobalFeatureManager.Instance.IsEnabled()) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs index e67a4f2d1b..335bbb9f78 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs @@ -35,6 +35,7 @@ namespace Volo.CmsKit.EntityFrameworkCore options.AddRepository(); options.AddRepository(); options.AddRepository(); + options.AddRepository(); options.AddRepository(); }); } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Pages/EfCorePageRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Pages/EfCorePageRepository.cs index 2fc6d92c52..d1d5578c02 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Pages/EfCorePageRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Pages/EfCorePageRepository.cs @@ -4,7 +4,9 @@ using System.Linq; using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; +using Volo.Abp; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore; @@ -17,13 +19,14 @@ namespace Volo.CmsKit.Pages { } - public virtual async Task GetCountAsync(string filter = null, CancellationToken cancellationToken = default) + public virtual async Task GetCountAsync(string filter = null, + CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()).WhereIf( - !filter.IsNullOrWhiteSpace(), - x => - x.Title.Contains(filter) - ).CountAsync(GetCancellationToken(cancellationToken)); + !filter.IsNullOrWhiteSpace(), + x => + x.Title.Contains(filter) + ).CountAsync(GetCancellationToken(cancellationToken)); } public virtual async Task> GetListAsync( @@ -34,27 +37,31 @@ namespace Volo.CmsKit.Pages CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()).WhereIf( - !filter.IsNullOrWhiteSpace(), - x => - x.Title.Contains(filter)) - .OrderBy(sorting ?? nameof(Page.Title)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); + !filter.IsNullOrWhiteSpace(), + x => + x.Title.Contains(filter)) + .OrderBy(sorting ?? nameof(Page.Title)) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); } - public virtual Task GetByUrlAsync(string url, CancellationToken cancellationToken = default) + public virtual Task GetBySlugAsync([NotNull] string slug, CancellationToken cancellationToken = default) { - return GetAsync(x => x.Url == url, cancellationToken: GetCancellationToken(cancellationToken)); + Check.NotNullOrEmpty(slug, nameof(slug)); + return GetAsync(x => x.Slug == slug, cancellationToken: GetCancellationToken(cancellationToken)); } - public virtual Task FindByUrlAsync(string url, CancellationToken cancellationToken = default) + public virtual Task FindBySlugAsync([NotNull] string slug, CancellationToken cancellationToken = default) { - return FindAsync(x => x.Url == url, cancellationToken: GetCancellationToken(cancellationToken)); + Check.NotNullOrEmpty(slug, nameof(slug)); + return FindAsync(x => x.Slug == slug, cancellationToken: GetCancellationToken(cancellationToken)); } - public virtual async Task ExistsAsync(string url, CancellationToken cancellationToken = default) + public virtual async Task ExistsAsync([NotNull] string slug, + CancellationToken cancellationToken = default) { - return await (await GetDbSetAsync()).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken)); + Check.NotNullOrEmpty(slug, nameof(slug)); + return await (await GetDbSetAsync()).AnyAsync(x => x.Slug == slug, GetCancellationToken(cancellationToken)); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs index f1d0119885..ae5d081b6a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs @@ -1,40 +1,43 @@ using JetBrains.Annotations; -using Nito.Disposables; using System; using System.Linq; -using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore; namespace Volo.CmsKit.Tags { - public class EfCoreEntityTagRepository: EfCoreRepository, IEntityTagRepository + public class EfCoreEntityTagRepository : EfCoreRepository, IEntityTagRepository { - public EfCoreEntityTagRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + public EfCoreEntityTagRepository(IDbContextProvider dbContextProvider) : base( + dbContextProvider) { } - public async Task DeleteManyAsync(Guid[] tagIds, CancellationToken cancellationToken = default) + public virtual async Task DeleteManyAsync(Guid[] tagIds, CancellationToken cancellationToken = default) { - var dbSet = await GetDbSetAsync(); - + var dbContext = await GetDbContextAsync(); + var dbSet = dbContext.Set(); dbSet.RemoveRange(dbSet.Where(x => tagIds.Contains(x.TagId))); + await dbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)); } - public Task FindAsync( + public virtual Task FindAsync( [NotNull] Guid tagId, [NotNull] string entityId, [CanBeNull] Guid? tenantId, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return base.FindAsync(x => - x.TagId == tagId && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: cancellationToken); + x.TagId == tagId && + x.EntityId == entityId && + x.TenantId == tenantId, + cancellationToken: GetCancellationToken(cancellationToken)); } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs index 3d917a059a..7325141c40 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs @@ -5,10 +5,9 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; +using Volo.Abp; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.VirtualFileSystem; using Volo.CmsKit.EntityFrameworkCore; namespace Volo.CmsKit.Tags @@ -25,6 +24,9 @@ namespace Volo.CmsKit.Tags Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(name, nameof(name)); + return await (await GetDbSetAsync()).AnyAsync(x => x.EntityType == entityType && x.Name == name && @@ -38,6 +40,9 @@ namespace Volo.CmsKit.Tags Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(name, nameof(name)); + return GetAsync(x => x.EntityType == entityType && x.Name == name && @@ -51,6 +56,9 @@ namespace Volo.CmsKit.Tags Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(name, nameof(name)); + return FindAsync(x => x.EntityType == entityType && x.Name == name && @@ -64,6 +72,9 @@ namespace Volo.CmsKit.Tags Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + var entityTagIds = await (await GetDbContextAsync()).Set() .Where(q => q.EntityId == entityId && q.TenantId == tenantId) .Select(q => q.TagId) diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogFeatureRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogFeatureRepository.cs new file mode 100644 index 0000000000..7c779af6c6 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogFeatureRepository.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MongoDB.Driver.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories.MongoDB; +using Volo.Abp.MongoDB; +using Volo.CmsKit.Blogs; +using MongoDB.Driver; + +namespace Volo.CmsKit.MongoDB.Blogs +{ + public class MongoBlogFeatureRepository : MongoDbRepository , IBlogFeatureRepository + { + public MongoBlogFeatureRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public Task FindAsync(Guid blogId, string featureName) + { + return base.FindAsync(x => x.BlogId == blogId && x.FeatureName == featureName); + } + + public async Task> GetListAsync(Guid blogId) + { + return await (await GetMongoQueryableAsync()) + .Where(x => x.BlogId == blogId) + .ToListAsync(); + } + + public async Task> GetListAsync(Guid blogId, List featureNames) + { + return await (await GetMongoQueryableAsync()) + .Where(x => x.BlogId == blogId && featureNames.Contains(x.FeatureName)) + .ToListAsync(); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs index 85dc1b86e0..6c75e7fec3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs @@ -7,6 +7,8 @@ using System.Linq; using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; +using Volo.Abp; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Blogs; @@ -16,34 +18,40 @@ namespace Volo.CmsKit.MongoDB.Blogs { public class MongoBlogPostRepository : MongoDbRepository, IBlogPostRepository { - public MongoBlogPostRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) + public MongoBlogPostRepository(IMongoDbContextProvider dbContextProvider) : base( + dbContextProvider) { } - public Task GetBySlugAsync(Guid blogId, string slug, CancellationToken cancellationToken = default) + public Task GetBySlugAsync(Guid blogId, [NotNull] string slug, + CancellationToken cancellationToken = default) { - return GetAsync(x => - x.BlogId == blogId && - x.Slug.ToLower() == slug, - includeDetails: true, - cancellationToken: cancellationToken); + Check.NotNullOrEmpty(slug, nameof(slug)); + + return GetAsync(x => + x.BlogId == blogId && + x.Slug.ToLower() == slug, + includeDetails: true, + cancellationToken: GetCancellationToken(cancellationToken)); } public async Task GetCountAsync(Guid blogId, CancellationToken cancellationToken = default) { return await AsyncExecuter.CountAsync( - await WithDetailsAsync(), - x => x.BlogId == blogId, - cancellationToken); + await WithDetailsAsync(), + x => x.BlogId == blogId, + GetCancellationToken(cancellationToken)); } - public async Task> GetPagedListAsync(Guid blogId, int skipCount, int maxResultCount, string sorting, bool includeDetails = false, CancellationToken cancellationToken = default) + public async Task> GetPagedListAsync(Guid blogId, int skipCount, int maxResultCount, + string sorting, bool includeDetails = false, CancellationToken cancellationToken = default) { - var dbContext = await GetDbContextAsync(cancellationToken); + var token = GetCancellationToken(cancellationToken); + var dbContext = await GetDbContextAsync(token); var blogPostQueryable = await WithDetailsAsync(); var queryable = blogPostQueryable - .Where(x => x.BlogId == blogId); + .Where(x => x.BlogId == blogId); if (!sorting.IsNullOrWhiteSpace()) { @@ -51,17 +59,20 @@ namespace Volo.CmsKit.MongoDB.Blogs } queryable = queryable - .Skip(skipCount) - .Take(maxResultCount); + .Skip(skipCount) + .Take(maxResultCount); - return await AsyncExecuter.ToListAsync(queryable, cancellationToken); + return await AsyncExecuter.ToListAsync(queryable, token); } - public async Task SlugExistsAsync(Guid blogId, string slug, CancellationToken cancellationToken = default) + public async Task SlugExistsAsync(Guid blogId, [NotNull] string slug, + CancellationToken cancellationToken = default) { - var queryable = await GetMongoQueryableAsync(); + Check.NotNullOrEmpty(slug, nameof(slug)); - return await queryable.AnyAsync(x => x.BlogId == blogId && x.Slug.ToLower() == slug, cancellationToken); + var token = GetCancellationToken(cancellationToken); + var queryable = await GetMongoQueryableAsync(token); + return await queryable.AnyAsync(x => x.BlogId == blogId && x.Slug.ToLower() == slug, token); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs index d733f82bf6..0cd46a130c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs @@ -1,6 +1,9 @@ using MongoDB.Driver.Core.Operations; using System; +using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; +using Volo.Abp; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Blogs; @@ -13,16 +16,18 @@ namespace Volo.CmsKit.MongoDB.Blogs { } - public async Task ExistsAsync(Guid blogId) + public virtual async Task ExistsAsync(Guid blogId, CancellationToken cancellationToken = default) { return await AsyncExecuter.AnyAsync( await GetQueryableAsync(), - x => x.Id == blogId); + x => x.Id == blogId, + cancellationToken); } - public Task GetBySlugAsync(string slug) + public virtual Task GetBySlugAsync([NotNull]string slug, CancellationToken cancellationToken = default) { - return GetAsync(x => x.Slug == slug); + Check.NotNullOrEmpty(slug, nameof(slug)); + return GetAsync(x => x.Slug == slug, cancellationToken: cancellationToken); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs index a62ed224df..cd03531448 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs @@ -36,7 +36,9 @@ namespace Volo.CmsKit.MongoDB public IMongoCollection Blogs => Collection(); public IMongoCollection BlogPosts => Collection(); - + + public IMongoCollection BlogFeatures => Collection(); + public IMongoCollection MediaDescriptors => Collection(); protected override void CreateModel(IMongoModelBuilder modelBuilder) diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs index f4e46a38fa..2a542472d2 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs @@ -76,6 +76,11 @@ namespace Volo.CmsKit.MongoDB { x.CollectionName = CmsKitDbProperties.DbTablePrefix + "BlogPosts"; }); + + builder.Entity(x => + { + x.CollectionName = CmsKitDbProperties.DbTablePrefix + "BlogFeatures"; + }); builder.Entity(x => { diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs index 5d16c6d55c..6c3158b0e5 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs @@ -1,14 +1,17 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; -using MongoDB.Driver.Linq; using MongoDB.Driver; +using MongoDB.Driver.Linq; using Volo.Abp; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Comments; +using Volo.CmsKit.Users; namespace Volo.CmsKit.MongoDB.Comments { @@ -18,6 +21,102 @@ namespace Volo.CmsKit.MongoDB.Comments { } + public async Task GetWithAuthorAsync(Guid id, CancellationToken cancellationToken = default) + { + var query = from comment in (await GetMongoQueryableAsync(cancellationToken)) + join user in (await GetDbContextAsync(cancellationToken)).CmsUsers on comment.CreatorId equals user.Id + where id == comment.Id + select new CommentWithAuthorQueryResultItem + { + Comment = comment, + Author = user + }; + + var commentWithAuthor = await query.FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + + if (commentWithAuthor == null) + { + throw new EntityNotFoundException(typeof(Comment), id); + } + + return commentWithAuthor; + } + + public async Task> GetListAsync( + string filter = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + string sorting = null, + int maxResultCount = int.MaxValue, + int skipCount = 0, + CancellationToken cancellationToken = default + ) + { + var token = GetCancellationToken(cancellationToken); + var query = await GetListQueryAsync( + filter, + entityType, + entityId, + repliedCommentId, + authorUsername, + creationStartDate, + creationEndDate, + token); + + var comments = await query.OrderBy(sorting ?? "creationTime desc") + .As>() + .PageBy>(skipCount, maxResultCount) + .ToListAsync(token); + + var commentIds = comments.Select(x => x.Id).ToList(); + + var authorsQuery = from comment in (await GetMongoQueryableAsync(token)) + join user in (await GetDbContextAsync(token)).CmsUsers on comment.CreatorId equals user.Id + where commentIds.Contains(comment.Id) + orderby comment.CreationTime + select user; + + var authors = await authorsQuery.ToListAsync(token); + + return comments + .Select( + comment => + new CommentWithAuthorQueryResultItem + { + Comment = comment, + Author = authors.FirstOrDefault(a => a.Id == comment.CreatorId) + }).ToList(); + } + + public async Task GetCountAsync( + string text = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + CancellationToken cancellationToken = default + ) + { + var query = await GetListQueryAsync( + text, + entityType, + entityId, + repliedCommentId, + authorUsername, + creationStartDate, + creationEndDate, + cancellationToken); + + return await query.As>() + .LongCountAsync(GetCancellationToken(cancellationToken)); + } + public async Task> GetListWithAuthorsAsync( string entityType, string entityId, @@ -70,5 +169,37 @@ namespace Volo.CmsKit.MongoDB.Comments cancellationToken: GetCancellationToken(cancellationToken) ); } + + protected virtual async Task> GetListQueryAsync( + string filter = null, + string entityType = null, + string entityId = null, + Guid? repliedCommentId = null, + string authorUsername = null, + DateTime? creationStartDate = null, + DateTime? creationEndDate = null, + CancellationToken cancellationToken = default + ) + { + var queryable = await GetMongoQueryableAsync(cancellationToken); + + if (!string.IsNullOrEmpty(authorUsername)) + { + var authorQueryable = (await GetDbContextAsync(cancellationToken)).Collection().AsQueryable(); + + var author = await authorQueryable.FirstOrDefaultAsync(x => x.UserName == authorUsername, cancellationToken: cancellationToken); + + var authorId = author?.Id ?? Guid.Empty; + + queryable = queryable.Where(x => x.CreatorId == authorId); + } + + return queryable.WhereIf(!filter.IsNullOrWhiteSpace(), c => c.Text.Contains(filter)) + .WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.EntityType == entityType) + .WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.EntityId == entityId) + .WhereIf(repliedCommentId.HasValue, c => c.RepliedCommentId == repliedCommentId) + .WhereIf(creationStartDate.HasValue, c => c.CreationTime >= creationStartDate) + .WhereIf(creationEndDate.HasValue, c => c.CreationTime <= creationEndDate); + } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs index 1068c352d5..fded228c16 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs @@ -3,6 +3,7 @@ using MongoDB.Driver.Linq; using System; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Contents; @@ -11,16 +12,20 @@ namespace Volo.CmsKit.MongoDB.Contents { public class MongoContentRepository : MongoDbRepository, IContentRepository { - public MongoContentRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) + public MongoContentRepository(IMongoDbContextProvider dbContextProvider) : base( + dbContextProvider) { } - public Task GetAsync( + public virtual Task GetAsync( string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return GetAsync(x => x.EntityType == entityType && x.EntityId == entityId && @@ -28,23 +33,30 @@ namespace Volo.CmsKit.MongoDB.Contents cancellationToken: GetCancellationToken(cancellationToken) ); } - - public Task FindAsync( + + public virtual Task FindAsync( string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return FindAsync(x => x.EntityType == entityType && x.EntityId == entityId && x.TenantId == tenantId, cancellationToken: GetCancellationToken(cancellationToken) - ); + ); } - public Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, + CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return DeleteAsync(x => x.EntityType == entityType && x.EntityId == entityId && @@ -52,8 +64,12 @@ namespace Volo.CmsKit.MongoDB.Contents cancellationToken: GetCancellationToken(cancellationToken)); } - public async Task ExistsAsync([NotNull] string entityType, [NotNull] string entityId, Guid? tenantId = null, CancellationToken cancellationToken = default) + public virtual async Task ExistsAsync([NotNull] string entityType, [NotNull] string entityId, + Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + return await (await GetMongoQueryableAsync(cancellationToken)).AnyAsync(x => x.EntityType == entityType && x.EntityId == entityId && diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs index f3cf7064f8..742d40dfc6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs @@ -36,6 +36,8 @@ namespace Volo.CmsKit.MongoDB IMongoCollection Blogs { get; } IMongoCollection BlogPosts { get; } + + IMongoCollection BlogFeatures { get; } IMongoCollection MediaDescriptors { get; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Pages/MongoPageRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Pages/MongoPageRepository.cs index af72da56c8..ec520fe809 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Pages/MongoPageRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Pages/MongoPageRepository.cs @@ -1,10 +1,12 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; +using JetBrains.Annotations; +using MongoDB.Driver; +using Volo.Abp; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using MongoDB.Driver; using MongoDB.Driver.Linq; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; @@ -14,14 +16,16 @@ namespace Volo.CmsKit.MongoDB.Pages { public class MongoPageRepository : MongoDbRepository, IPageRepository { - public MongoPageRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) + public MongoPageRepository(IMongoDbContextProvider dbContextProvider) : base( + dbContextProvider) { } - public virtual async Task GetCountAsync(string filter = null, CancellationToken cancellationToken = default) + public virtual async Task GetCountAsync(string filter = null, + CancellationToken cancellationToken = default) { var cancellation = GetCancellationToken(cancellationToken); - + return await (await GetMongoQueryableAsync(cancellation)) .WhereIf>( !filter.IsNullOrWhiteSpace(), @@ -33,12 +37,12 @@ namespace Volo.CmsKit.MongoDB.Pages public virtual async Task> GetListAsync( string filter = null, int maxResultCount = int.MaxValue, - int skipCount = 0, + int skipCount = 0, string sorting = null, CancellationToken cancellationToken = default) { var cancellation = GetCancellationToken(cancellationToken); - + return await (await GetMongoQueryableAsync(cancellation)) .WhereIf>( !filter.IsNullOrWhiteSpace(), @@ -51,19 +55,23 @@ namespace Volo.CmsKit.MongoDB.Pages .ToListAsync(cancellation); } - public virtual Task GetByUrlAsync(string url, CancellationToken cancellationToken = default) + public virtual Task GetBySlugAsync([NotNull]string slug, CancellationToken cancellationToken = default) { - return GetAsync(x => x.Url == url, cancellationToken: GetCancellationToken(cancellationToken)); + Check.NotNullOrEmpty(slug, nameof(slug)); + return GetAsync(x => x.Slug == slug, cancellationToken: GetCancellationToken(cancellationToken)); } - public virtual Task FindByUrlAsync(string url, CancellationToken cancellationToken = default) + public virtual Task FindBySlugAsync([NotNull]string slug, CancellationToken cancellationToken = default) { - return FindAsync(x => x.Url == url, cancellationToken: GetCancellationToken(cancellationToken)); + Check.NotNullOrEmpty(slug, nameof(slug)); + return FindAsync(x => x.Slug == slug, cancellationToken: GetCancellationToken(cancellationToken)); } - - public virtual async Task ExistsAsync(string url, CancellationToken cancellationToken = default) + + public virtual async Task ExistsAsync([NotNull]string slug, CancellationToken cancellationToken = default) { - return await (await GetMongoQueryableAsync(cancellationToken)).AnyAsync(x => x.Url == url, GetCancellationToken(cancellationToken)); + Check.NotNullOrEmpty(slug, nameof(slug)); + return await (await GetMongoQueryableAsync(cancellationToken)).AnyAsync(x => x.Slug == slug, + GetCancellationToken(cancellationToken)); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs index c073f8206f..041b6af5a2 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs @@ -4,23 +4,26 @@ using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Tags; namespace Volo.CmsKit.MongoDB.Tags { - public class MongoEntityTagRepository: MongoDbRepository, IEntityTagRepository + public class MongoEntityTagRepository : MongoDbRepository, IEntityTagRepository { - public MongoEntityTagRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) + public MongoEntityTagRepository(IMongoDbContextProvider dbContextProvider) : base( + dbContextProvider) { } public async Task DeleteManyAsync(Guid[] tagIds, CancellationToken cancellationToken = default) { - var collection = await GetCollectionAsync(); - - await collection.DeleteManyAsync(Builders.Filter.In(x => x.TagId, tagIds)); + var token = GetCancellationToken(cancellationToken); + + var collection = await GetCollectionAsync(token); + await collection.DeleteManyAsync(Builders.Filter.In(x => x.TagId, tagIds), token); } public Task FindAsync( @@ -29,11 +32,12 @@ namespace Volo.CmsKit.MongoDB.Tags [CanBeNull] Guid? tenantId, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityId, nameof(entityId)); return base.FindAsync(x => - x.TagId == tagId && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: cancellationToken); + x.TagId == tagId && + x.EntityId == entityId && + x.TenantId == tenantId, + cancellationToken: GetCancellationToken(cancellationToken)); } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs index 02c42c22fb..5e8fdf94a7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Tags; @@ -24,6 +25,9 @@ namespace Volo.CmsKit.MongoDB.Tags Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(name, nameof(name)); + return await (await GetMongoQueryableAsync(cancellationToken)) .AnyAsync(x => x.EntityType == entityType && @@ -51,6 +55,9 @@ namespace Volo.CmsKit.MongoDB.Tags Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(name, nameof(name)); + return FindAsync(x => x.EntityType == entityType && x.Name == name && @@ -64,6 +71,9 @@ namespace Volo.CmsKit.MongoDB.Tags Guid? tenantId = null, CancellationToken cancellationToken = default) { + Check.NotNullOrEmpty(entityType, nameof(entityType)); + Check.NotNullOrEmpty(entityId, nameof(entityId)); + var entityTagIds = await (await GetDbContextAsync(cancellationToken)).EntityTags.AsQueryable() .Where(q => q.EntityId == entityId && q.TenantId == tenantId) .Select(q => q.TagId) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/GetBlogFeatureInput.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/GetBlogFeatureInput.cs new file mode 100644 index 0000000000..8be4ebaa07 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/GetBlogFeatureInput.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Volo.CmsKit.Public.Blogs +{ + public class GetBlogFeatureInput + { + public List FeatureNames { get; set; } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs index 0c9079ee7e..04234b4f06 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs @@ -1,4 +1,5 @@ -using System; +using JetBrains.Annotations; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; @@ -8,9 +9,9 @@ namespace Volo.CmsKit.Public.Blogs { public interface IBlogPostPublicAppService { - Task> GetListAsync(string blogSlug, PagedAndSortedResultRequestDto input); + Task> GetListAsync([NotNull] string blogSlug, PagedAndSortedResultRequestDto input); - Task GetAsync(string blogSlug, string blogPostSlug); + Task GetAsync([NotNull] string blogSlug, [NotNull] string blogPostSlug); Task GetCoverImageAsync(Guid id); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentPublicAppService.cs similarity index 78% rename from modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentAppService.cs rename to modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentPublicAppService.cs index 6f691ceca1..df8b07cfce 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentPublicAppService.cs @@ -3,8 +3,8 @@ using Volo.CmsKit.Contents; namespace Volo.CmsKit.Public.Contents { - public interface IContentAppService + public interface IContentPublicAppService { Task GetAsync(GetContentInput input); } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPageAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs similarity index 51% rename from modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPageAppService.cs rename to modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs index 7363d32a3c..1e37e92b71 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPageAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs @@ -3,8 +3,8 @@ using JetBrains.Annotations; namespace Volo.CmsKit.Public.Pages { - public interface IPageAppService + public interface IPagePublicAppService { - Task FindByUrlAsync([NotNull] string url); + Task FindBySlugAsync([NotNull] string slug); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs index ab8ee9ee80..19a3664578 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs @@ -7,6 +7,6 @@ namespace Volo.CmsKit.Public.Pages { public string Title { get; set; } - public string Url { get; set; } + public string Slug { get; set; } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs index 3994720d73..644b4e4cc3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs @@ -1,4 +1,5 @@ -using System; +using JetBrains.Annotations; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; @@ -26,7 +27,7 @@ namespace Volo.CmsKit.Public.Blogs BlobContainer = blobContainer; } - public async Task GetAsync(string blogSlug, string blogPostSlug) + public virtual async Task GetAsync([NotNull] string blogSlug, [NotNull] string blogPostSlug) { var blog = await BlogRepository.GetBySlugAsync(blogSlug); @@ -35,7 +36,7 @@ namespace Volo.CmsKit.Public.Blogs return ObjectMapper.Map(blogPost); } - public async Task> GetListAsync(string blogSlug, PagedAndSortedResultRequestDto input) + public virtual async Task> GetListAsync([NotNull] string blogSlug, PagedAndSortedResultRequestDto input) { var blog = await BlogRepository.GetBySlugAsync(blogSlug); @@ -46,7 +47,7 @@ namespace Volo.CmsKit.Public.Blogs ObjectMapper.Map, List>(blogPosts)); } - public async Task GetCoverImageAsync(Guid id) + public virtual async Task GetCoverImageAsync(Guid id) { var stream = await BlobContainer.GetAsync(id.ToString()); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/CmsKitPublicApplicationModule.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/CmsKitPublicApplicationModule.cs index c8cda19e68..ede4a7ef29 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/CmsKitPublicApplicationModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/CmsKitPublicApplicationModule.cs @@ -1,12 +1,14 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; +using Volo.Abp.Caching; using Volo.Abp.Modularity; namespace Volo.CmsKit.Public { [DependsOn( typeof(CmsKitCommonApplicationModule), - typeof(CmsKitPublicApplicationContractsModule) + typeof(CmsKitPublicApplicationContractsModule), + typeof(AbpCachingModule) )] public class CmsKitPublicApplicationModule : AbpModule { 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 a4ce4a2b46..f283473f95 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 @@ -52,6 +52,11 @@ namespace Volo.CmsKit.Public.Comments { var user = await CmsUserLookupService.GetByIdAsync(CurrentUser.GetId()); + if(input.RepliedCommentId.HasValue) + { + await CommentRepository.GetAsync(input.RepliedCommentId.Value); + } + var comment = await CommentRepository.InsertAsync( new Comment( GuidGenerator.Create(), diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs similarity index 68% rename from modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentAppService.cs rename to modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs index 94cffea154..995c99c2ed 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs @@ -3,11 +3,11 @@ using Volo.CmsKit.Contents; namespace Volo.CmsKit.Public.Contents { - public class ContentAppService : CmsKitAppServiceBase, IContentAppService + public class ContentPublicAppService : CmsKitPublicAppServiceBase, IContentPublicAppService { - protected readonly IContentRepository ContentRepository; + protected IContentRepository ContentRepository { get; } - public ContentAppService(IContentRepository contentRepository) + public ContentPublicAppService(IContentRepository contentRepository) { ContentRepository = contentRepository; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PageAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PageAppService.cs deleted file mode 100644 index 1e1d63bf71..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PageAppService.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Threading.Tasks; -using Volo.CmsKit.Pages; - -namespace Volo.CmsKit.Public.Pages -{ - public class PageAppService : CmsKitPublicAppServiceBase, IPageAppService - { - protected readonly IPageRepository PageRepository; - - public PageAppService(IPageRepository pageRepository) - { - PageRepository = pageRepository; - } - - public virtual async Task FindByUrlAsync(string url) - { - var page = await PageRepository.FindByUrlAsync(url); - - if (page == null) - { - return null; - } - - return ObjectMapper.Map(page); - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs new file mode 100644 index 0000000000..6f93c938e9 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using Volo.CmsKit.Pages; + +namespace Volo.CmsKit.Public.Pages +{ + public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppService + { + protected IPageRepository PageRepository { get; } + + public PagePublicAppService(IPageRepository pageRepository) + { + PageRepository = pageRepository; + } + + public virtual async Task FindBySlugAsync(string slug) + { + PageDto pageDto = null; + var page = await PageRepository.FindBySlugAsync(slug); + + if (page !=null) + { + pageDto = ObjectMapper.Map(page); + } + + return pageDto; + } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs index 46dab5a9a1..ee8a09e8df 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs @@ -34,6 +34,8 @@ namespace Volo.CmsKit.Public CreateMap(); CreateMap(MemberList.None); + + CreateMap(); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs index 7f3545ad9c..e22ef54545 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs @@ -1,15 +1,11 @@ using Microsoft.AspNetCore.Mvc; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Content; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.GlobalFeatures; -using Volo.CmsKit.Public.Blogs; namespace Volo.CmsKit.Public.Blogs { @@ -28,14 +24,14 @@ namespace Volo.CmsKit.Public.Blogs [HttpGet] [Route("{blogSlug}/{blogPostSlug}")] - public Task GetAsync(string blogSlug, string blogPostSlug) + public virtual Task GetAsync(string blogSlug, string blogPostSlug) { return BlogPostPublicAppService.GetAsync(blogSlug, blogPostSlug); } [HttpGet] [Route("{id}/cover-image")] - public Task GetCoverImageAsync(Guid id) + public virtual Task GetCoverImageAsync(Guid id) { Response.Headers.Add("Content-Disposition", $"inline;filename=\"{id}\""); Response.Headers.Add("Accept-Ranges", "bytes"); @@ -47,7 +43,7 @@ namespace Volo.CmsKit.Public.Blogs [HttpGet] [Route("{blogSlug}")] - public Task> GetListAsync(string blogSlug, PagedAndSortedResultRequestDto input) + public virtual Task> GetListAsync(string blogSlug, PagedAndSortedResultRequestDto input) { return BlogPostPublicAppService.GetListAsync(blogSlug, input); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Contents/ContentController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Contents/ContentController.cs index 4a348fc7bf..9ba368f03d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Contents/ContentController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Contents/ContentController.cs @@ -1,27 +1,29 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Contents; +using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit.Public.Contents { - + [RequiresGlobalFeature(typeof(ContentsFeature))] [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] [Area("cms-kit")] [Route("api/cms-kit-public/contents")] - public class ContentController : CmsKitControllerBase, IContentAppService + public class ContentController : CmsKitControllerBase, IContentPublicAppService { - protected readonly IContentAppService _contentAppService; + protected IContentPublicAppService ContentAppService { get; } - public ContentController(IContentAppService contentAppService) + public ContentController(IContentPublicAppService contentAppService) { - _contentAppService = contentAppService; + ContentAppService = contentAppService; } [HttpGet] public virtual Task GetAsync(GetContentInput input) { - return _contentAppService.GetAsync(input); + return ContentAppService.GetAsync(input); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs index a9c6cd70e4..970e6b1847 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs @@ -1,26 +1,29 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit.Public.Pages { + [RequiresGlobalFeature(typeof(PagesFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area("cms-kit")] - [Route("api/cms-kit-public/comments")] - public class PagesPublicController : IPageAppService + [Route("api/cms-kit-public/pages")] + public class PagesPublicController : IPagePublicAppService { - protected readonly IPageAppService PageAppService; + protected IPagePublicAppService PageAppService { get; } - public PagesPublicController(IPageAppService pageAppService) + public PagesPublicController(IPagePublicAppService pageAppService) { PageAppService = pageAppService; } [HttpGet] - [Route("url/{url}")] - public Task FindByUrlAsync(string url) + [Route("{slug}")] + public virtual Task FindBySlugAsync(string slug) { - return PageAppService.FindByUrlAsync(url); + return PageAppService.FindBySlugAsync(slug); } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs index 55041e5c6e..b1f18e2511 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs @@ -14,7 +14,7 @@ namespace Volo.CmsKit.Public.Tags [Route("api/cms-kit-public/tags")] public class TagPublicController : CmsKitPublicControllerBase, ITagAppService { - protected readonly ITagAppService TagAppService; + protected ITagAppService TagAppService { get; } public TagPublicController(ITagAppService tagAppService) { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs index b5c7b9bb3f..fe30d70b50 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs @@ -59,9 +59,13 @@ namespace Volo.CmsKit.Public.Web public override void PostConfigureServices(ServiceConfigurationContext context) { - Configure(options => + if (GlobalFeatureManager.Instance.IsEnabled()) { - }); + Configure(options => + { + options.Conventions.AddPageRoute("/CmsKit/Pages/Index", @"/pages/{slug:minlength(1)}"); + }); + } } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Controllers/PageController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Controllers/PageController.cs deleted file mode 100644 index 5d3d5acc9c..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Controllers/PageController.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ActionConstraints; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.GlobalFeatures; -using Volo.CmsKit.GlobalFeatures; -using Volo.CmsKit.Public.Pages; - -namespace Volo.CmsKit.Public.Web.Controllers -{ - [RequiresGlobalFeature(typeof(PagesFeature))] - public class PageController : CmsKitPublicControllerBase - { - protected IPageAppService PageAppService { get; } - - public PageController(IPageAppService pageAppService) - { - PageAppService = pageAppService; - } - - //[HttpGet("/{*url}", Order = int.MaxValue)] - public async Task IndexAsync(string url) - { - var page = await PageAppService.FindByUrlAsync(url); - - if (page == null) - { - return NotFound(); - } - - return View("~/Views/Page/Index.cshtml", page); - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml index 51472ce7c1..4eb2fa0ccd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml @@ -26,38 +26,50 @@ @if (GlobalFeatureManager.Instance.IsEnabled()) { - @await Component.InvokeAsync(typeof(TagViewComponent), new + if (Model.TagsFeature?.IsEnabled == true) { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) + @await Component.InvokeAsync(typeof(TagViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.BlogPost.Id.ToString() + }) + } } @if (GlobalFeatureManager.Instance.IsEnabled()) { - @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new + if (Model.ReactionsFeature?.IsEnabled == true) { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) + @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.BlogPost.Id.ToString() + }) + } } @if (GlobalFeatureManager.Instance.IsEnabled()) { - @await Component.InvokeAsync(typeof(RatingViewComponent), new + if (Model.RatingsFeature?.IsEnabled == true) { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) + @await Component.InvokeAsync(typeof(RatingViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.BlogPost.Id.ToString() + }) + } }
@if (GlobalFeatureManager.Instance.IsEnabled()) { - @await Component.InvokeAsync(typeof(DefaultBlogPostCommentViewComponent), new + if (Model.CommentsFeature?.IsEnabled == true) { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) + @await Component.InvokeAsync(typeof(DefaultBlogPostCommentViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.BlogPost.Id.ToString() + }) + } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml.cs index a3f31bb9a2..bf10548027 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Blogs/BlogPost.cshtml.cs @@ -2,8 +2,12 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading.Tasks; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Blogs; +using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Public.Blogs; namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Blogs @@ -18,16 +22,49 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Blogs public BlogPostPublicDto BlogPost { get; private set; } + public BlogFeatureDto CommentsFeature { get; private set; } + + public BlogFeatureDto ReactionsFeature { get; private set; } + + public BlogFeatureDto RatingsFeature { get; private set; } + + public BlogFeatureDto TagsFeature { get; private set; } + protected IBlogPostPublicAppService BlogPostPublicAppService { get; } - public BlogPostModel(IBlogPostPublicAppService blogPostPublicAppService) + protected IBlogFeatureAppService BlogFeatureAppService { get; } + + public BlogPostModel( + IBlogPostPublicAppService blogPostPublicAppService, + IBlogFeatureAppService blogFeaturePublicAppService) { BlogPostPublicAppService = blogPostPublicAppService; + BlogFeatureAppService = blogFeaturePublicAppService; } - public async Task OnGetAsync() + public virtual async Task OnGetAsync() { BlogPost = await BlogPostPublicAppService.GetAsync(BlogSlug, BlogPostSlug); + + if (GlobalFeatureManager.Instance.IsEnabled()) + { + CommentsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, BlogPostConsts.CommentsFeatureName); + } + + if (GlobalFeatureManager.Instance.IsEnabled()) + { + ReactionsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, BlogPostConsts.ReactionsFeatureName); + } + + if (GlobalFeatureManager.Instance.IsEnabled()) + { + RatingsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, BlogPostConsts.RatingsFeatureName); + } + + if (GlobalFeatureManager.Instance.IsEnabled()) + { + TagsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, BlogPostConsts.TagsFeatureName); + } } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Pages/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Pages/Index.cshtml new file mode 100644 index 0000000000..4f4129b6d7 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Pages/Index.cshtml @@ -0,0 +1,13 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.CmsKit.Localization +@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages +@model Volo.CmsKit.Public.Web.Pages.CmsKit.Pages.IndexModel +@inject IHtmlLocalizer L + +@await Component.InvokeAsync(typeof(DefaultPageViewComponent), + new + { + pageId = Model.Page.Id, + title = Model.Page.Title + }) \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Pages/Index.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Pages/Index.cshtml.cs new file mode 100644 index 0000000000..155a85d94f --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Pages/Index.cshtml.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.CmsKit.Public.Pages; +using Volo.CmsKit.Web.Pages; + +namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Pages +{ + public class IndexModel : CommonPageModel + { + [BindProperty(SupportsGet = true)] + public string Slug { get; set; } + + protected IPagePublicAppService PagePublicAppService { get; } + + public PageDto Page; + + public IndexModel(IPagePublicAppService pagePublicAppService) + { + PagePublicAppService = pagePublicAppService; + } + + public async Task OnGetAsync() + { + Page = await PagePublicAppService.FindBySlugAsync(Slug); + + if (Page == null) + { + return NotFound(); + } + + return Page(); + } + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/ContentViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/ContentViewComponent.cs index 6a2a4e5a13..70baaf4436 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/ContentViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/ContentViewComponent.cs @@ -12,11 +12,11 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Contents public class ContentViewComponent : AbpViewComponent { private readonly IContentRenderer contentRenderer; - private readonly IContentAppService contentAppService; + private readonly IContentPublicAppService contentAppService; public ContentViewComponent( IContentRenderer contentRenderer, - IContentAppService contentAppService) + IContentPublicAppService contentAppService) { this.contentRenderer = contentRenderer; this.contentAppService = contentAppService; diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs index c3e02b1f90..c972643359 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs @@ -9,11 +9,11 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages [ViewComponent(Name = "CmsDefaultPage")] public class DefaultPageViewComponent : AbpViewComponent { - protected readonly IPageAppService PageAppService; + protected IPagePublicAppService PagePublicAppService { get; } - public DefaultPageViewComponent(IPageAppService pageAppService) + public DefaultPageViewComponent(IPagePublicAppService pagePublicAppService) { - PageAppService = pageAppService; + PagePublicAppService = pagePublicAppService; } public virtual async Task InvokeAsync(Guid pageId, string title, string description) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Views/Page/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Views/Page/Index.cshtml deleted file mode 100644 index de094041e4..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Views/Page/Index.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@model Volo.CmsKit.Public.Pages.PageDto - -@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages - -@await Component.InvokeAsync(typeof(DefaultPageViewComponent), new -{ - pageId = Model.Id, - title = Model.Title -}) \ No newline at end of file diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogFeatureAdminAppService_Test.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogFeatureAdminAppService_Test.cs new file mode 100644 index 0000000000..54ce2d6de5 --- /dev/null +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogFeatureAdminAppService_Test.cs @@ -0,0 +1,67 @@ +using Shouldly; +using System.Threading.Tasks; +using Volo.CmsKit.Admin.Blogs; +using Xunit; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeatureAdminAppService_Test : CmsKitApplicationTestBase + { + private readonly CmsKitTestData testData; + private readonly IBlogFeatureAdminAppService blogFeatureAdminAppService; + private readonly IBlogFeatureRepository blogFeatureRepository; + + public BlogFeatureAdminAppService_Test() + { + testData = GetRequiredService(); + blogFeatureAdminAppService = GetRequiredService(); + blogFeatureRepository = GetRequiredService(); + } + + [Fact] + public async Task SetAsync_ShouldWorkProperly_WithNonExistingFeature() + { + var dto = new BlogFeatureInputDto + { + FeatureName = "My.Awesome.Feature", + IsEnabled = true + }; + + await blogFeatureAdminAppService.SetAsync(testData.Blog_Id, dto); + + var feature = await blogFeatureRepository.FindAsync(testData.Blog_Id, dto.FeatureName); + + feature.ShouldNotBeNull(); + feature.BlogId.ShouldBe(testData.Blog_Id); + feature.IsEnabled.ShouldBe(dto.IsEnabled); + } + + [Fact] + public async Task SetAsync_ShouldWorkProperly_WithExistingFeature() + { + var dto = new BlogFeatureInputDto + { + FeatureName = testData.BlogFeature_2_FeatureName, + IsEnabled = !testData.BlogFeature_2_Enabled + }; + + await blogFeatureAdminAppService.SetAsync(testData.Blog_Id, dto); + + var feature = await blogFeatureRepository.FindAsync(testData.Blog_Id, dto.FeatureName); + + feature.ShouldNotBeNull(); + feature.BlogId.ShouldBe(testData.Blog_Id); + feature.IsEnabled.ShouldBe(dto.IsEnabled); + } + + [Fact] + public async Task GetListAsync_ShouldWorkProperly_WithBlogId() + { + var result = await blogFeatureAdminAppService.GetListAsync(testData.Blog_Id); + + result.ShouldNotBeNull(); + result.ShouldNotBeEmpty(); + result.Count.ShouldBeGreaterThan(2); // 2 are seeded and there are built-in Features. + } + } +} diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogFeaturePublicAppService_Test.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogFeaturePublicAppService_Test.cs new file mode 100644 index 0000000000..e4c3d99f92 --- /dev/null +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogFeaturePublicAppService_Test.cs @@ -0,0 +1,43 @@ +using Shouldly; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.CmsKit.Public.Blogs; +using Xunit; + +namespace Volo.CmsKit.Blogs +{ + public class BlogFeaturePublicAppService_Test : CmsKitApplicationTestBase + { + private readonly CmsKitTestData testData; + private readonly IBlogFeatureAppService blogFeatureAppService; + + public BlogFeaturePublicAppService_Test() + { + testData = GetRequiredService(); + blogFeatureAppService = GetRequiredService(); + } + + [Fact] + public async Task GetAsync_ShouldWorkProperly_WithExistingFeatureName() + { + var result = await blogFeatureAppService.GetOrDefaultAsync(testData.Blog_Id, testData.BlogFeature_1_FeatureName); + + result.ShouldNotBeNull(); + result.FeatureName.ShouldBe(testData.BlogFeature_1_FeatureName); + } + + [Fact] + public async Task GetAsync_ShouldReturnDefault_WithNonExistingFeatureName() + { + var nonExistingFeatureName = "AnyOtherFeature"; + var result = await blogFeatureAppService.GetOrDefaultAsync(testData.Blog_Id, nonExistingFeatureName); + + var defaultFeature = new BlogFeature(Guid.Empty, nonExistingFeatureName); + result.ShouldNotBeNull(); + result.IsEnabled.ShouldBe(defaultFeature.IsEnabled); + } + } +} diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs index efef70cb9b..abc6ea54b9 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs @@ -31,7 +31,7 @@ namespace Volo.CmsKit.Blogs var slug = "my-awesome-new-post"; var shortDescription = "This blog is all about awesomeness 🤗!"; - var created = await blogPostAdminAppService.CreateAsync(new CreateUpdateBlogPostDto + var created = await blogPostAdminAppService.CreateAsync(new CreateBlogPostDto { BlogId = cmsKitTestData.Blog_Id, Title = title, @@ -55,7 +55,7 @@ namespace Volo.CmsKit.Blogs var slug = "another-my-awesome-new-post"; var shortDescription = "This blog is all about awesomeness 🤗!"; - var dto = new CreateUpdateBlogPostDto + var dto = new CreateBlogPostDto { // Non-existing Id BlogId = Guid.NewGuid(), @@ -114,7 +114,7 @@ namespace Volo.CmsKit.Blogs { var nonExistingSlug = "any-other-url"; var exception = await Should.ThrowAsync(async () => - await blogPostAdminAppService.GetBySlugAsync(nonExistingSlug, cmsKitTestData.Page_1_Url)); + await blogPostAdminAppService.GetBySlugAsync(nonExistingSlug, cmsKitTestData.Page_1_Slug)); exception.EntityType.ShouldBe(typeof(Blog)); } @@ -137,9 +137,8 @@ namespace Volo.CmsKit.Blogs var title = "[Solved] Another Blog Post"; var slug = "another-short-blog-post"; - await blogPostAdminAppService.UpdateAsync(cmsKitTestData.BlogPost_2_Id, new CreateUpdateBlogPostDto + await blogPostAdminAppService.UpdateAsync(cmsKitTestData.BlogPost_2_Id, new UpdateBlogPostDto { - BlogId = cmsKitTestData.Blog_Id, ShortDescription = shortDescription, Title = title, Slug = slug, @@ -152,31 +151,11 @@ namespace Volo.CmsKit.Blogs blogPost.Slug.ShouldBe(slug); } - [Fact] - public async Task UpdateAsync_ShouldThrowException_WhileChangingWithNonExistingBlogId() - { - var nonExistingId = Guid.NewGuid(); - - var dto = new CreateUpdateBlogPostDto - { - BlogId = nonExistingId, - Title = cmsKitTestData.Page_2_Title, - Slug = cmsKitTestData.BlogPost_2_Slug - }; - - var exception = await Should.ThrowAsync(async () => - await blogPostAdminAppService.UpdateAsync(cmsKitTestData.BlogPost_2_Id, dto)); - - exception.EntityType.ShouldBe(typeof(Blog)); - exception.Id.ShouldBe(nonExistingId); - } - [Fact] public async Task UpdateAsync_ShouldThrowException_WhileUpdatingWithAlreadyExistingSlug() { - var dto = new CreateUpdateBlogPostDto + var dto = new UpdateBlogPostDto { - BlogId = cmsKitTestData.Blog_Id, Title = "Some new title", Slug = cmsKitTestData.BlogPost_1_Slug }; diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentAdminAppService_Tests.cs new file mode 100644 index 0000000000..7c62889201 --- /dev/null +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentAdminAppService_Tests.cs @@ -0,0 +1,51 @@ +using System.Linq; +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Domain.Entities; +using Volo.CmsKit.Admin.Comments; +using Xunit; + +namespace Volo.CmsKit.Comments +{ + public class CommentAdminAppService_Tests : CmsKitApplicationTestBase + { + private readonly ICommentAdminAppService _commentAdminAppService; + private readonly CmsKitTestData _cmsKitTestData; + + public CommentAdminAppService_Tests() + { + _commentAdminAppService = GetRequiredService(); + _cmsKitTestData = GetRequiredService(); + } + + [Fact] + public async Task ShouldGet_PagedListAsync() + { + var comments = await _commentAdminAppService.GetListAsync(new CommentGetListInput + { + MaxResultCount = 3 + }); + + comments.TotalCount.ShouldBe(6); + comments.Items.Count.ShouldBe(3); + comments.Items.Any(x => x.Author != null).ShouldBeTrue(); + } + + [Fact] + public async Task ShouldGet_CommentWithAuthorAsync() + { + var comment = await _commentAdminAppService.GetAsync(_cmsKitTestData.CommentWithChildId); + + comment.ShouldNotBeNull(); + comment.Author.ShouldNotBeNull(); + } + + [Fact] + public async Task ShouldDelete_WithRepliesAsync() + { + await _commentAdminAppService.DeleteAsync(_cmsKitTestData.CommentWithChildId); + + await Should.ThrowAsync(async () => await _commentAdminAppService.GetAsync(_cmsKitTestData.CommentWithChildId)); + } + } +} \ No newline at end of file diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs index 7fa0d934fb..1dfbc0fe02 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs @@ -64,12 +64,12 @@ namespace Volo.CmsKit.Pages var dto = new CreatePageInputDto { Title = "test", - Url = "test-url" + Slug = "test-url" }; await Should.NotThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); - var page = await _pageRepository.GetByUrlAsync(dto.Url); + var page = await _pageRepository.GetBySlugAsync(dto.Slug); page.Title.ShouldBe(dto.Title); } @@ -80,12 +80,12 @@ namespace Volo.CmsKit.Pages var dto = new CreatePageInputDto { Title = "test", - Url = _data.Page_1_Url + Slug = _data.Page_1_Slug }; - var exception = await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); + var exception = await Should.ThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); - exception.Code.ShouldBe(CmsKitErrorCodes.Pages.UrlAlreadyExist); + exception.Code.ShouldBe(CmsKitErrorCodes.Pages.SlugAlreadyExist); } [Fact] @@ -95,7 +95,7 @@ namespace Volo.CmsKit.Pages { Title = _data.Page_1_Title + "++", Description = "new description", - Url = _data.Page_1_Url+ "test" + Slug = _data.Page_1_Slug+ "test" }; await Should.NotThrowAsync(async () => await _pageAdminAppService.UpdateAsync(_data.Page_1_Id, dto)); @@ -105,8 +105,8 @@ namespace Volo.CmsKit.Pages updatedPage.Title.ShouldNotBe(_data.Page_1_Title); updatedPage.Title.ShouldBe(dto.Title); - updatedPage.Url.ShouldNotBe(_data.Page_1_Url); - updatedPage.Url.ShouldBe(dto.Url); + updatedPage.Slug.ShouldNotBe(_data.Page_1_Slug); + updatedPage.Slug.ShouldBe(dto.Slug); updatedPage.Description.ShouldNotBe(_data.Page_1_Description); updatedPage.Description.ShouldBe(dto.Description); @@ -119,7 +119,7 @@ namespace Volo.CmsKit.Pages { Title = _data.Page_1_Title + "++", Description = "new description", - Url = _data.Page_2_Url + Slug = _data.Page_2_Slug }; await Should.ThrowAsync(async () => await _pageAdminAppService.UpdateAsync(_data.Page_1_Id, dto)); diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs index c0943a1279..6b16e35f41 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs @@ -9,18 +9,18 @@ namespace Volo.CmsKit.Pages public class PagePublicAppService_Tests : CmsKitApplicationTestBase { private readonly CmsKitTestData _data; - private readonly IPageAppService _pageAppService; + private readonly IPagePublicAppService _pageAppService; public PagePublicAppService_Tests() { _data = GetRequiredService(); - _pageAppService = GetRequiredService(); + _pageAppService = GetRequiredService(); } [Fact] public async Task ShouldFindByUrlAsync() { - var page = await _pageAppService.FindByUrlAsync(_data.Page_1_Url); + var page = await _pageAppService.FindBySlugAsync(_data.Page_1_Slug); page.ShouldNotBeNull(); page.Title.ShouldBe(_data.Page_1_Title); @@ -29,7 +29,7 @@ namespace Volo.CmsKit.Pages [Fact] public async Task ShouldNotGetByUrlAsync() { - var page = await _pageAppService.FindByUrlAsync("not-exist-url"); + var page = await _pageAppService.FindBySlugAsync("not-exist-url"); page.ShouldBeNull(); } diff --git a/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/Blogs/BlogFeatureRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/Blogs/BlogFeatureRepository_Test.cs new file mode 100644 index 0000000000..d6acb2b162 --- /dev/null +++ b/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/Blogs/BlogFeatureRepository_Test.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.CmsKit.Blogs; + +namespace Volo.CmsKit.EntityFrameworkCore.Blogs +{ + public class BlogFeatureRepository_Test : BlogFeatureRepository_Test + { + + } +} diff --git a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/Blogs/BlogFeatureRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/Blogs/BlogFeatureRepository_Test.cs new file mode 100644 index 0000000000..35ccc0664c --- /dev/null +++ b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/Blogs/BlogFeatureRepository_Test.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.CmsKit.Blogs; + +namespace Volo.CmsKit.MongoDB.Blogs +{ + public class BlogFeatureRepository_Test : BlogFeatureRepository_Test + { + + } +} diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Blogs/BlogFeatureRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Blogs/BlogFeatureRepository_Test.cs new file mode 100644 index 0000000000..334489a2aa --- /dev/null +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/Blogs/BlogFeatureRepository_Test.cs @@ -0,0 +1,69 @@ +using Shouldly; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Modularity; +using Xunit; + +namespace Volo.CmsKit.Blogs +{ + public abstract class BlogFeatureRepository_Test : CmsKitTestBase + where TStartupModule : IAbpModule + { + private readonly CmsKitTestData testData; + private readonly IBlogFeatureRepository blogFeatureRepository; + public BlogFeatureRepository_Test() + { + testData = GetRequiredService(); + blogFeatureRepository = GetRequiredService(); + } + + [Fact] + public async Task GetListAsync_ShouldWorkProperly_WithBlogId() + { + var result = await blogFeatureRepository.GetListAsync(testData.Blog_Id); + + result.ShouldNotBeNull(); + result.ShouldNotBeEmpty(); + result.Count.ShouldBe(2); + } + + [Fact] + public async Task GetListAsync_ShouldWorkProperly_WithBlogIdWithFeatureNames() + { + var result = await blogFeatureRepository.GetListAsync(testData.Blog_Id, new List { testData.BlogFeature_1_FeatureName }); + + result.ShouldNotBeNull(); + result.ShouldNotBeEmpty(); + result.Count.ShouldBe(1); + } + + [Fact] + public async Task FindAsync_ShouldWorkProperly_WithExistingFeatureName() + { + var result = await blogFeatureRepository.FindAsync(testData.Blog_Id, testData.BlogFeature_1_FeatureName); + + result.ShouldNotBeNull(); + result.FeatureName.ShouldBe(testData.BlogFeature_1_FeatureName); + result.IsEnabled.ShouldBe(testData.BlogFeature_1_Enabled); + } + + [Fact] + public async Task FindAsync_ShouldReturnNull_WithNonExistingFeatureName() + { + var nonExistingFeatureName = "Some.Feature"; + var result = await blogFeatureRepository.FindAsync(testData.Blog_Id, nonExistingFeatureName); + + result.ShouldBeNull(); + } + + [Fact] + public async Task FindAsync_ShouldReturnNull_WithNonExistingBlogId() + { + var nonExistingBlogId = Guid.NewGuid(); + var result = await blogFeatureRepository.FindAsync(nonExistingBlogId, testData.BlogFeature_1_FeatureName); + + result.ShouldBeNull(); + } + } +} diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs index 68a65de89e..788b428d69 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs @@ -39,6 +39,7 @@ namespace Volo.CmsKit private readonly IEntityTagRepository _entityTagRepository; private readonly IPageRepository _pageRepository; private readonly IBlogRepository _blogRepository; + private readonly IBlogFeatureRepository _blogFeatureRepository; private readonly IBlogPostRepository _blogPostRepository; private readonly IOptions _options; private readonly IOptions _tagOptions; @@ -59,6 +60,7 @@ namespace Volo.CmsKit IPageRepository pageRepository, IBlogRepository blogRepository, IBlogPostRepository blogPostRepository, + IBlogFeatureRepository blogFeatureRepository, IEntityTagManager entityTagManager, IOptions options, IOptions tagOptions, @@ -79,6 +81,7 @@ namespace Volo.CmsKit _pageRepository = pageRepository; _blogRepository = blogRepository; _blogPostRepository = blogPostRepository; + _blogFeatureRepository = blogFeatureRepository; _options = options; _tagOptions = tagOptions; _mediaDescriptorRepository = mediaDescriptorRepository; @@ -107,6 +110,8 @@ namespace Volo.CmsKit await SeedBlogsAsync(); + await SeedBlogFeaturesAsync(); + await SeedMediaAsync(); } } @@ -305,13 +310,13 @@ namespace Volo.CmsKit private async Task SeedPagesAsync() { - var page1 = new Page(_cmsKitTestData.Page_1_Id, _cmsKitTestData.Page_1_Title, _cmsKitTestData.Page_1_Url, _cmsKitTestData.Page_1_Description); + var page1 = new Page(_cmsKitTestData.Page_1_Id, _cmsKitTestData.Page_1_Title, _cmsKitTestData.Page_1_Slug, _cmsKitTestData.Page_1_Description); var page1Content = new Content(_guidGenerator.Create(), nameof(Page), page1.Id.ToString(), _cmsKitTestData.Page_1_Content); await _pageRepository.InsertAsync(page1); await _contentRepository.InsertAsync(page1Content); - var page2 = new Page(_cmsKitTestData.Page_2_Id, _cmsKitTestData.Page_2_Title, _cmsKitTestData.Page_2_Url, _cmsKitTestData.Page_2_Description); + var page2 = new Page(_cmsKitTestData.Page_2_Id, _cmsKitTestData.Page_2_Title, _cmsKitTestData.Page_2_Slug, _cmsKitTestData.Page_2_Description); var page2Content = new Content(_guidGenerator.Create(), nameof(Page), page2.Id.ToString(), _cmsKitTestData.Page_2_Content); await _pageRepository.InsertAsync(page2); @@ -327,6 +332,25 @@ namespace Volo.CmsKit await _blogPostRepository.InsertAsync(new BlogPost(_cmsKitTestData.BlogPost_2_Id, blog.Id, _cmsKitTestData.BlogPost_2_Title, _cmsKitTestData.BlogPost_2_Slug, "Short desc 2")); } + private async Task SeedBlogFeaturesAsync() + { + var blogFeature1 = await _blogFeatureRepository.InsertAsync( + new BlogFeature( + _cmsKitTestData.Blog_Id, + _cmsKitTestData.BlogFeature_1_FeatureName, + _cmsKitTestData.BlogFeature_1_Enabled)); + + _cmsKitTestData.BlogFeature_1_Id = blogFeature1.Id; + + var blogFeature2 = await _blogFeatureRepository.InsertAsync( + new BlogFeature( + _cmsKitTestData.Blog_Id, + _cmsKitTestData.BlogFeature_2_FeatureName, + _cmsKitTestData.BlogFeature_2_Enabled)); + + _cmsKitTestData.BlogFeature_2_Id = blogFeature2.Id; + } + private async Task SeedMediaAsync() { using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(_cmsKitTestData.Media_1_Content))) diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestData.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestData.cs index b0b4a5b1ba..d6a1aad24e 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestData.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitTestData.cs @@ -45,7 +45,7 @@ namespace Volo.CmsKit public string Page_1_Title { get; } = "Imagine Dragons - Believer Lyrics"; - public string Page_1_Url { get; } = "imagine-dragons-believer-lyrics"; + public string Page_1_Slug { get; } = "imagine-dragons-believer-lyrics"; public string Page_1_Description { get; } = "You can get the lyrics of the music."; @@ -55,7 +55,7 @@ namespace Volo.CmsKit public string Page_2_Title { get; } = "Imagine Dragons - Believer Lyrics (Page 2)"; - public string Page_2_Url { get; } = "imagine-dragons-believer-lyrics-2"; + public string Page_2_Slug { get; } = "imagine-dragons-believer-lyrics-2"; public string Page_2_Description { get; } = "You can get the lyrics of the music."; @@ -91,6 +91,18 @@ namespace Volo.CmsKit public string BlogPost_2_Slug => "how-to-use-cms-kit"; + public Guid BlogFeature_1_Id { get; internal set; } = Guid.NewGuid(); + + public string BlogFeature_1_FeatureName => "Analytics"; + + public bool BlogFeature_1_Enabled => true; + + public Guid BlogFeature_2_Id { get; internal set; } = Guid.NewGuid(); + + public string BlogFeature_2_FeatureName => "Hotjar"; + + public bool BlogFeature_2_Enabled => false; + public Guid Media_1_Id { get; } = Guid.NewGuid(); public string Media_1_Content = "Hi, this is text file"; diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Comments/CommentRepository_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Comments/CommentRepository_Tests.cs index 80b3052798..3b166834a0 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/Comments/CommentRepository_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/Comments/CommentRepository_Tests.cs @@ -18,6 +18,31 @@ namespace Volo.CmsKit.Comments _commentRepository = GetRequiredService(); } + [Fact] + public async Task GetList_ShouldWork() + { + var comments = await _commentRepository.GetListAsync(); + + comments.ShouldNotBeNull(); + comments.Count.ShouldBe(6); + + var headCommentId = comments.First(x => x.Comment.RepliedCommentId != null).Comment.RepliedCommentId; + + var replies = await _commentRepository.GetListAsync(repliedCommentId: headCommentId); + + replies.ShouldNotBeNull(); + replies.Count.ShouldBeLessThan(6); + replies.Count.ShouldBeGreaterThanOrEqualTo(1); + } + + [Fact] + public async Task GetCount_ShouldWork() + { + var commentsCount = await _commentRepository.GetCountAsync(); + + commentsCount.ShouldBe(6); + } + [Fact] public async Task GetListWithAuthorsAsync() { @@ -38,7 +63,7 @@ namespace Volo.CmsKit.Comments var list = await _commentRepository.GetListAsync(); list.Any(x=> - x.Id == _cmsKitTestData.CommentWithChildId || x.RepliedCommentId == _cmsKitTestData.CommentWithChildId) + x.Comment.Id == _cmsKitTestData.CommentWithChildId || x.Comment.RepliedCommentId == _cmsKitTestData.CommentWithChildId) .ShouldBeFalse(); } } diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Pages/PageRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Pages/PageRepository_Test.cs index 67a691c5a8..56a5c916ab 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/Pages/PageRepository_Test.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/Pages/PageRepository_Test.cs @@ -53,7 +53,7 @@ namespace Volo.CmsKit.Pages [Fact] public async Task ShouldGetByUrlAsync() { - var page = await _pageRepository.GetByUrlAsync(_cmsKitTestData.Page_1_Url); + var page = await _pageRepository.GetBySlugAsync(_cmsKitTestData.Page_1_Slug); page.ShouldNotBeNull(); page.Description.ShouldBe(_cmsKitTestData.Page_1_Description); @@ -62,7 +62,7 @@ namespace Volo.CmsKit.Pages [Fact] public async Task ShouldFindByUrlAsync() { - var page = await _pageRepository.FindByUrlAsync(_cmsKitTestData.Page_1_Url); + var page = await _pageRepository.FindBySlugAsync(_cmsKitTestData.Page_1_Slug); page.ShouldNotBeNull(); page.Description.ShouldBe(_cmsKitTestData.Page_1_Description); @@ -71,7 +71,7 @@ namespace Volo.CmsKit.Pages [Fact] public async Task ShouldNotFindByUrlAsync() { - var page = await _pageRepository.FindByUrlAsync("not-exist-lyrics"); + var page = await _pageRepository.FindBySlugAsync("not-exist-lyrics"); page.ShouldBeNull(); } @@ -79,7 +79,7 @@ namespace Volo.CmsKit.Pages [Fact] public async Task ShouldBeExistAsync() { - var page = await _pageRepository.ExistsAsync(_cmsKitTestData.Page_1_Url); + var page = await _pageRepository.ExistsAsync(_cmsKitTestData.Page_1_Slug); page.ShouldBeTrue(); } diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml index aa8d7313d9..7f55a7b8fa 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml @@ -44,14 +44,13 @@ var disabled = Model.IsDisabled(feature.Provider.Name);
- - + @if (feature.ValueType is ToggleStringValueType) { } - +
} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs index d2ccc5a44d..9598c9a46a 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs @@ -75,13 +75,6 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement return providerName != ProviderName && providerName != DefaultValueFeatureValueProvider.ProviderName; } - public class ProviderInfoViewModel - { - public string ProviderName { get; set; } - - public string ProviderKey { get; set; } - } - public class FeatureGroupViewModel { public List Features { get; set; } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeedContributor.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeedContributor.cs index a5af0acf2c..82677d74e4 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeedContributor.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeedContributor.cs @@ -6,6 +6,11 @@ namespace Volo.Abp.Identity { public class IdentityDataSeedContributor : IDataSeedContributor, ITransientDependency { + public const string AdminEmailPropertyName = "AdminEmail"; + public const string AdminEmailDefaultValue = "admin@abp.io"; + public const string AdminPasswordPropertyName = "AdminPassword"; + public const string AdminPasswordDefaultValue = "1q2w3E*"; + protected IIdentityDataSeeder IdentityDataSeeder { get; } public IdentityDataSeedContributor(IIdentityDataSeeder identityDataSeeder) @@ -16,8 +21,8 @@ namespace Volo.Abp.Identity public virtual Task SeedAsync(DataSeedContext context) { return IdentityDataSeeder.SeedAsync( - context?["AdminEmail"] as string ?? "admin@abp.io", - context?["AdminPassword"] as string ?? "1q2w3E*", + context?[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue, + context?[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue, context?.TenantId ); } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContext.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContext.cs index eddf19cd29..49341771ca 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContext.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContext.cs @@ -7,9 +7,11 @@ using Volo.Abp.IdentityServer.Devices; using Volo.Abp.IdentityServer.Grants; using Volo.Abp.IdentityServer.IdentityResources; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.IdentityServer.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpIdentityServerDbProperties.ConnectionStringName)] public class AbpIdentityServerMongoDbContext : AbpMongoDbContext, IAbpIdentityServerMongoDbContext { diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IAbpIdentityServerMongoDbContext.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IAbpIdentityServerMongoDbContext.cs index 5b521f2600..ad9c90b62c 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IAbpIdentityServerMongoDbContext.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IAbpIdentityServerMongoDbContext.cs @@ -7,9 +7,11 @@ using Volo.Abp.IdentityServer.Devices; using Volo.Abp.IdentityServer.Grants; using Volo.Abp.IdentityServer.IdentityResources; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.IdentityServer.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpIdentityServerDbProperties.ConnectionStringName)] public interface IAbpIdentityServerMongoDbContext : IAbpMongoDbContext { diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissionDefinitionProvider.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissionDefinitionProvider.cs index 6c93975aa8..a7c7c7f983 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissionDefinitionProvider.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissionDefinitionProvider.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.SettingManagement public override void Define(IPermissionDefinitionContext context) { var moduleGroup = context.AddGroup(SettingManagementPermissions.GroupName, L("Permission:SettingManagement")); - moduleGroup.AddPermission(SettingManagementPermissions.EmailSettingManagement, L("Permission:EmailSettingManagement"), multiTenancySide: MultiTenancySides.Host); + moduleGroup.AddPermission(SettingManagementPermissions.EmailSetting, L("Permission:EmailSetting"), multiTenancySide: MultiTenancySides.Host); } private static LocalizableString L(string name) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissions.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissions.cs index 62d4448549..eb68845487 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissions.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissions.cs @@ -6,7 +6,7 @@ namespace Volo.Abp.SettingManagement { public const string GroupName = "SettingManagement"; - public const string EmailSettingManagement = GroupName + ".EmailSettingManagement"; + public const string EmailSetting = GroupName + ".EmailSetting"; public static string[] GetAll() { diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/EmailSettingsAppService.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/EmailSettingsAppService.cs index c1eb5fc304..ee5e4ec430 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/EmailSettingsAppService.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/EmailSettingsAppService.cs @@ -5,7 +5,7 @@ using Volo.Abp.Emailing; namespace Volo.Abp.SettingManagement { - [Authorize(SettingManagementPermissions.EmailSettingManagement)] + [Authorize(SettingManagementPermissions.EmailSetting)] public class EmailSettingsAppService : SettingManagementAppServiceBase, IEmailSettingsAppService { protected ISettingManager SettingManager { get; } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/AbpSettingManagementBlazorModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/AbpSettingManagementBlazorModule.cs index 14bd1bdd55..de17beec9e 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/AbpSettingManagementBlazorModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/AbpSettingManagementBlazorModule.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.SettingManagement.Blazor Configure(options => { - options.Contributors.Add(new EmailSettingManagementPageContributor()); + options.Contributors.Add(new EmailSettingPageContributor()); }); } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs index e88d9cdf3b..0836aa88a9 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs @@ -35,7 +35,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.EmailSetting { await EmailSettingsAppService.UpdateAsync(ObjectMapper.Map(EmailSettings)); - await UiMessageService.Success(L["SavedSuccessfully"]); + await UiMessageService.Success(L["SuccessfullySaved"]); } } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingManagementPageContributor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingPageContributor.cs similarity index 87% rename from modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingManagementPageContributor.cs rename to modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingPageContributor.cs index 8266618cef..b1f6e9d63a 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingManagementPageContributor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/EmailSettingPageContributor.cs @@ -7,7 +7,7 @@ using Volo.Abp.SettingManagement.Localization; namespace Volo.Abp.SettingManagement.Blazor.Settings { - public class EmailSettingManagementPageContributor: ISettingComponentContributor + public class EmailSettingPageContributor: ISettingComponentContributor { public async Task ConfigureAsync(SettingComponentCreationContext context) { @@ -20,7 +20,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Settings context.Groups.Add( new SettingComponentGroup( "Volo.Abp.SettingManagement", - l["Menu:EmailSettingManagement"], + l["Menu:EmailSetting"], typeof(EmailSettingGroupViewComponent) ) ); @@ -35,7 +35,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Settings { var authorizationService = context.ServiceProvider.GetRequiredService(); - return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSettingManagement); + return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSetting); } } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de-DE.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de-DE.json index 78300d8530..ef0af78334 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de-DE.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de-DE.json @@ -4,8 +4,8 @@ "Settings": "Einstellungen", "SuccessfullySaved": "Erfolgreich gespeichert", "Permission:SettingManagement": "Einstellungen-Verwaltung", - "Permission:EmailSettingManagement": "E-Mail-Einstellungen", - "Menu:EmailSettingManagement": "E-Mail-Verwaltung", + "Permission:EmailSetting": "E-Mail-Einstellungen", + "Menu:EmailSetting": "E-Mail-Einstellung", "SmtpHost": "Host", "SmtpPort": "Port", "SmtpUserName": "Benutzername", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json index 5cbee9f36c..37ce73fcb2 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json @@ -4,8 +4,8 @@ "Settings": "Settings", "SuccessfullySaved": "Successfully saved", "Permission:SettingManagement": "Setting Management", - "Permission:EmailSettingManagement": "Email Settings", - "Menu:EmailSettingManagement": "Email management", + "Permission:EmailSetting": "Email Setting", + "Menu:EmailSetting": "Email Setting", "SmtpHost": "Host", "SmtpPort": "Port", "SmtpUserName": "User name", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json index d2f833a686..7bd35306bb 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json @@ -4,8 +4,8 @@ "Settings": "Configuraciones", "SuccessfullySaved": "Guardado correctamente", "Permission:SettingManagement": "Configuraciones de correo electronico", - "Permission:EmailSettingManagement": "Administración Configuraciones", - "Menu:EmailSettingManagement": "Administración de correo electronico", + "Permission:EmailSetting": "Configuración de correo electrónico", + "Menu:EmailSetting": "Configuración de correo electrónico", "SmtpHost": "Host", "SmtpPort": "Puerto", "SmtpUserName": "Nombre de usuario", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json index de00a854c0..4710abde96 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json @@ -4,8 +4,8 @@ "Settings": "Ayarlar", "SuccessfullySaved": "Başarıyla Kaydedildi", "Permission:SettingManagement": "Ayarlar yönetimi", - "Permission:EmailSettingManagement": "Email Ayarlar", - "Menu:EmailSettingManagement": "Email yönetimi", + "Permission:EmailSetting": "Email Ayarlar", + "Menu:EmailSetting": "Email Ayarlar", "SmtpHost": "Sunucu", "SmtpPort": "Port", "SmtpUserName": "Kullanıcı adı", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json index 653ff051ee..5a2053700a 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json @@ -4,8 +4,8 @@ "Settings": "设置", "SuccessfullySaved": "保存成功", "Permission:SettingManagement": "设置管理", - "Permission:EmailSettingManagement": "邮件设置", - "Menu:EmailSettingManagement": "邮件管理", + "Permission:EmailSetting": "邮件设置", + "Menu:EmailSetting": "邮件设置", "SmtpHost": "主机", "SmtpPort": "端口", "SmtpUserName": "用户名", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs index 139b654030..84113041b8 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs @@ -34,7 +34,7 @@ namespace Volo.Abp.SettingManagement.Web Configure(options => { - options.Contributors.Add(new EmailSettingManagementPageContributor()); + options.Contributors.Add(new EmailSettingPageContributor()); }); Configure(options => diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingManagementPageContributor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingPageContributor.cs similarity index 85% rename from modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingManagementPageContributor.cs rename to modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingPageContributor.cs index 8df3a2c76f..b7888a8eb2 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingManagementPageContributor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Settings/EmailSettingPageContributor.cs @@ -8,7 +8,7 @@ using Volo.Abp.SettingManagement.Web.Pages.SettingManagement.Components.EmailSet namespace Volo.Abp.SettingManagement.Web.Settings { - public class EmailSettingManagementPageContributor: ISettingPageContributor + public class EmailSettingPageContributor: ISettingPageContributor { public async Task ConfigureAsync(SettingPageCreationContext context) { @@ -20,8 +20,8 @@ namespace Volo.Abp.SettingManagement.Web.Settings var l = context.ServiceProvider.GetRequiredService>(); context.Groups.Add( new SettingPageGroup( - "Volo.Abp.SettingManagement", - l["Menu:EmailSettingManagement"], + "Volo.Abp.EmailSetting", + l["Menu:EmailSetting"], typeof(EmailSettingGroupViewComponent) ) ); @@ -36,7 +36,7 @@ namespace Volo.Abp.SettingManagement.Web.Settings { var authorizationService = context.ServiceProvider.GetRequiredService(); - return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSettingManagement); + return await authorizationService.IsGrantedAsync(SettingManagementPermissions.EmailSetting); } } } diff --git a/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts index c0dc284815..fbb19ac3fc 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts @@ -1,8 +1,8 @@ -import { Component, forwardRef, Input, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'; import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest'; -import { AbstractNgModelComponent } from '../abstracts'; import { timer } from 'rxjs'; +import { AbstractNgModelComponent } from '../abstracts'; @Component({ selector: 'abp-test', @@ -10,8 +10,7 @@ import { timer } from 'rxjs'; providers: [ { provide: NG_VALUE_ACCESSOR, - // tslint:disable-next-line: no-forward-ref - useExisting: forwardRef(() => TestComponent), + useExisting: TestComponent, multi: true, }, ], diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index 16f13513ee..8fcb74149a 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -86,7 +86,7 @@ $projects = ( "framework/src/Volo.Abp.Emailing", "framework/src/Volo.Abp.EntityFrameworkCore", "framework/src/Volo.Abp.EntityFrameworkCore.MySQL", - # "framework/src/Volo.Abp.EntityFrameworkCore.Oracle", + "framework/src/Volo.Abp.EntityFrameworkCore.Oracle", "framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart", "framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql", "framework/src/Volo.Abp.EntityFrameworkCore.Sqlite", diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Data/MyProjectNameDbMigrationService.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Data/MyProjectNameDbMigrationService.cs index f33076746a..08d784f58d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Data/MyProjectNameDbMigrationService.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Data/MyProjectNameDbMigrationService.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; using Volo.Abp.MultiTenancy; using Volo.Abp.TenantManagement; @@ -105,7 +106,10 @@ namespace MyCompanyName.MyProjectName.Data { Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); - await _dataSeeder.SeedAsync(tenant?.Id); + await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id) + .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue) + .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue) + ); } private bool DbMigrationsProjectExists() diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index 5cf421b265..2bfbe80fdc 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -215,6 +215,7 @@ namespace MyCompanyName.MyProjectName var configuration = context.GetConfiguration(); options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); + options.OAuthScopes("MyProjectName"); }); app.UseAuditing(); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json index 12bd4f78bb..33a3d0140a 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json @@ -16,16 +16,5 @@ }, "StringEncryption": { "DefaultPassPhrase": "gsKnGZ041HLL4IM8" - }, - "Settings": { - "Abp.Mailing.Smtp.Host": "127.0.0.1", - "Abp.Mailing.Smtp.Port": "25", - "Abp.Mailing.Smtp.UserName": "", - "Abp.Mailing.Smtp.Password": "", - "Abp.Mailing.Smtp.Domain": "", - "Abp.Mailing.Smtp.EnableSsl": "false", - "Abp.Mailing.Smtp.UseDefaultCredentials": "true", - "Abp.Mailing.DefaultFromAddress": "noreply@abp.io", - "Abp.Mailing.DefaultFromDisplayName": "ABP application" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj index 196166e966..7483325232 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj @@ -12,7 +12,6 @@ - diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs index 7893d38ff8..ed2628947a 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs @@ -231,6 +231,7 @@ namespace MyCompanyName.MyProjectName var configuration = context.ServiceProvider.GetRequiredService(); c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); c.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); + c.OAuthScopes("MyProjectName"); }); app.UseAuditing(); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json index 2d9ec044c9..c0918002d5 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json @@ -16,16 +16,5 @@ }, "StringEncryption": { "DefaultPassPhrase": "gsKnGZ041HLL4IM8" - }, - "Settings": { - "Abp.Mailing.Smtp.Host": "127.0.0.1", - "Abp.Mailing.Smtp.Port": "25", - "Abp.Mailing.Smtp.UserName": "", - "Abp.Mailing.Smtp.Password": "", - "Abp.Mailing.Smtp.Domain": "", - "Abp.Mailing.Smtp.EnableSsl": "false", - "Abp.Mailing.Smtp.UseDefaultCredentials": "true", - "Abp.Mailing.DefaultFromAddress": "noreply@abp.io", - "Abp.Mailing.DefaultFromDisplayName": "ABP application" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/appsettings.json index 404920f4b2..00f7dcefe2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/appsettings.json @@ -13,16 +13,5 @@ }, "StringEncryption": { "DefaultPassPhrase": "gsKnGZ041HLL4IM8" - }, - "Settings": { - "Abp.Mailing.Smtp.Host": "127.0.0.1", - "Abp.Mailing.Smtp.Port": "25", - "Abp.Mailing.Smtp.UserName": "", - "Abp.Mailing.Smtp.Password": "", - "Abp.Mailing.Smtp.Domain": "", - "Abp.Mailing.Smtp.EnableSsl": "false", - "Abp.Mailing.Smtp.UseDefaultCredentials": "true", - "Abp.Mailing.DefaultFromAddress": "noreply@abp.io", - "Abp.Mailing.DefaultFromDisplayName": "ABP application" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/appsettings.json index 9c81e66699..f6f012fcfb 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/appsettings.json @@ -11,16 +11,5 @@ }, "StringEncryption": { "DefaultPassPhrase": "gsKnGZ041HLL4IM8" - }, - "Settings": { - "Abp.Mailing.Smtp.Host": "127.0.0.1", - "Abp.Mailing.Smtp.Port": "25", - "Abp.Mailing.Smtp.UserName": "", - "Abp.Mailing.Smtp.Password": "", - "Abp.Mailing.Smtp.Domain": "", - "Abp.Mailing.Smtp.EnableSsl": "false", - "Abp.Mailing.Smtp.UseDefaultCredentials": "true", - "Abp.Mailing.DefaultFromAddress": "noreply@abp.io", - "Abp.Mailing.DefaultFromDisplayName": "ABP application" } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index db77093f0a..c118624476 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -182,6 +182,7 @@ namespace MyCompanyName.MyProjectName var configuration = context.GetConfiguration(); options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); + options.OAuthScopes("MyProjectName"); }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj index be27176f6c..8124338091 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj @@ -12,7 +12,6 @@ - all runtime; build; native; contentfiles; analyzers