diff --git a/docs/en/Getting-Started-AspNetCore-Application.md b/docs/en/Getting-Started-AspNetCore-Application.md index 8c0d03b6bb..fe1ff3450b 100644 --- a/docs/en/Getting-Started-AspNetCore-Application.md +++ b/docs/en/Getting-Started-AspNetCore-Application.md @@ -1,6 +1,6 @@ # Getting Started ABP With AspNet Core MVC Web Application -This tutorial explains how to start ABP from scratch with minimal dependencies. You generally want to start with a **[startup template](https://abp.io/Templates)**. +This tutorial explains how to start ABP from scratch with minimal dependencies. You generally want to start with the **[startup template](Getting-Started-AspNetCore-MVC-Template.md)**. ## Create A New Project diff --git a/docs/en/Getting-Started-AspNetCore-MVC-Template.md b/docs/en/Getting-Started-AspNetCore-MVC-Template.md index 665cec98b1..de9a5b09cb 100644 --- a/docs/en/Getting-Started-AspNetCore-MVC-Template.md +++ b/docs/en/Getting-Started-AspNetCore-MVC-Template.md @@ -1,5 +1,7 @@ ## ASP.NET Core MVC Template +This tutorials explains how to create a new ASP.NET Core MVC web application using the startup template, configure and run it. + ### Creating a new project Go to [the template creation page](https://abp.io/Templates), enter a project name and create your project as shown below: diff --git a/docs/en/Index.md b/docs/en/Index.md index 18df429102..df0cab524a 100644 --- a/docs/en/Index.md +++ b/docs/en/Index.md @@ -1,64 +1,30 @@ # ABP Documentation -* Getting Started - * From Startup Templates - * [ASP.NET Core MVC Template](Getting-Started-AspNetCore-MVC-Template.md) - * From Empty Projects - * [With Console Application](Getting-Started-Console-Application.md) - * [With ASP.NET Core Web Application](Getting-Started-AspNetCore-Application.md) -* Tutorials - * Application Development - * [With ASP.NET Core MVC](Tutorials/AspNetCore-Mvc/Part-I.md) -* Fundamentals - * [Dependency Injection](Dependency-Injection.md) - * [AutoFac Integration](Autofac-Integration.md) - * [Virtual File System](Virtual-File-System.md) - * [Localization](Localization.md) - * [Exception Handling](Exception-Handling.md) - * Validation - * Authorization - * Caching - * Auditing - * Setting Management - * Object to Object Mapping - * AutoMapper Integration -* Events - * Event Bus (local) - * Distributed Event Bus - * RabbitMQ Integration -* Services - * Object Serialization - * JSON Serialization - * Emailing - * GUIDs - * Threading - * Timing -* [Multi Tenancy](Multi-Tenancy.md) -* Module Development - * [Basics](Module-Development-Basics.md) - * Plug-In Modules - * [Best Practices](Best-Practices/Index.md) -* Domain Driven Design - * Domain Layer - * [Entities & Aggregate Roots](Entities.md) - * Value Objects - * [Repositories](Repositories.md) - * Domain Services - * Specifications - * Application Layer - * Application Services - * Data Transfer Objects - * Unit Of Work -* ASP.NET Core MVC - * API Versioning - * User Interface - * [Client Side Package Management](AspNetCore/Client-Side-Package-Management.md) - * [Bundling & Minification](AspNetCore/Bundling-Minification.md) - * [Tag Helpers](Tag-Helpers.md) - * [Theming](AspNetCore/Theming.md) -* Data Access - * [Entity Framework Core Integration](Entity-Framework-Core.md) - * [MongoDB Integration](MongoDB.md) -* Background - * [Background Jobs](Background-Jobs.md) -* Testing +ABP is an **open source application framework** focused on ASP.NET Core based web application development, but also supports developing other types of applications. + +Explore the left navigation menu to deep dive in the documentation. + +## Project Status + +ABP is the **next generation** of the open source [ASP.NET Boilerplate](https://aspnetboilerplate.com/) framework. It's currently in early preview stage and not ready to use in production. The documentation is in progress and currently is very incomplete. + +For short-term and production applications, it's suggested to use the [ASP.NET Boilerplate](https://aspnetboilerplate.com/) framework which is feature rich, mature, maintained and up-to-date. + +## Getting Started + +Easiest way to start a new project with ABP is to use the Startup templates: + +* [ASP.NET Core MVC Template](Getting-Started-AspNetCore-MVC-Template.md) + +If you want to start from scratch (with an empty project) then manually install the ABP framework, use following tutorials: + +* [Console Application](Getting-Started-Console-Application.md) +* [ASP.NET Core Web Application](Getting-Started-AspNetCore-Application.md) + +## Source Code + +ABP is being developed on GitHub. See [the source code](https://github.com/abpframework/abp). + +## Want to Contribute? + +ABP is a community-driven open source project. See [the contribution guide](Contribution/Index.md) if you want to be a part of this project. \ No newline at end of file diff --git a/docs/en/Module-Development-Basics.md b/docs/en/Module-Development-Basics.md index 6e1c724669..6a0561a0c5 100644 --- a/docs/en/Module-Development-Basics.md +++ b/docs/en/Module-Development-Basics.md @@ -1,10 +1,10 @@ -## Module Development +# Module Development -### Introduction +## Introduction -ABP is itself a modular framework. It also provides an infrastructure and architectural model to develop your own modules. +ABP is a **modular application framework** which consists of dozens of **nuget packages**. It also provides a complete infrastructure to build your own application modules which may have entities, services, database integration, APIs, UI components and so on. -### Module Class +## Module Class Every module should define a module class. The simplest way of defining a module class is to create a class derived from ``AbpModule`` as shown below: @@ -16,9 +16,9 @@ public class BlogModule : AbpModule ```` -#### Configuring Dependency Injection & Other Modules +### Configuring Dependency Injection & Other Modules -##### ConfigureServices Method +#### ConfigureServices Method ``ConfigureServices`` is the main method to add your services to the dependency injection system and configure other modules. Example: @@ -52,15 +52,15 @@ public class BlogModule : AbpModule See Configuration (TODO: link) document for more about the configuration system. -##### Pre & Post Configure Services +#### Pre & Post Configure Services ``AbpModule`` class also defines ``PreConfigureServices`` and ``PostConfigureServices`` methods to override and write your code just before and just after ``ConfigureServices``. Notice that the code you have written into these methods will be executed before/after the ``ConfigureServices`` methods of all other modules. -#### Application Initialization +### Application Initialization Once all the services of all modules are configured, the application starts by initializing all modules. In this phase, you can resolve services from ``IServiceProvider`` since it's ready and available. -##### OnApplicationInitialization Method +#### OnApplicationInitialization Method You can override ``OnApplicationInitialization`` method to execute code while application is being started. Example: @@ -102,15 +102,15 @@ public class AppModule : AbpModule You can also perform startup logic if your module requires it -##### Pre & Post Application Initialization +#### Pre & Post Application Initialization ``AbpModule`` class also defines ``OnPreApplicationInitialization`` and ``OnPostApplicationInitialization`` methods to override and write your code just before and just after ``OnApplicationInitialization``. Notice that the code you have written into these methods will be executed before/after the ``OnApplicationInitialization`` methods of all other modules. -#### Application Shutdown +### Application Shutdown -Lastly, you can override ``OnApplicationShutdown`` method if you want to execute some code while application is beign shutdown. +Lastly, you can override ``OnApplicationShutdown`` method if you want to execute some code while application is being shutdown. -### Module Dependencies +## Module Dependencies In a modular application, it's not unusual for one module to depend upon another module(s). An Abp module must declare ``[DependsOn]`` attribute if it does have a dependcy upon another module, as shown below: @@ -126,3 +126,10 @@ public class BlogModule You can use multiple ``DependsOn`` attribute or pass multiple module types to a single ``DependsOn`` attribute depending on your preference. A depended module may depend on another module, but you only need to define your direct dependencies. ABP investigates the dependency graph for the application at startup and initializes/shutdowns modules in the correct order. + +## Framework Modules vs Application Modules + +There are **two types of modules.** They don't have any structural difference but categorized by functionality and purpose: + +- **Framework modules**: These are **core modules of the framework** like caching, emailing, theming, security, serialization, validation, EF Core integration, MongoDB integration... etc. They do not have application/business functionalities but makes your daily development easier by providing common infrastructure, integration and abstractions. +- **Application modules**: These modules implement **specific application/business functionalities** like blogging, document management, identity management, tenant management... etc. They generally have their own entities, services, APIs and UI components. See [pre-built application modules](Modules/Index.md). \ No newline at end of file diff --git a/docs/en/Modules/Docs.md b/docs/en/Modules/Docs.md new file mode 100644 index 0000000000..adfcd15453 --- /dev/null +++ b/docs/en/Modules/Docs.md @@ -0,0 +1,9 @@ +# Docs Module + +Docs module is used to create technical documentation pages. ABP's [own documentation](https://abp.io/documents/) already using this module. + +> Docs module follows the [module architecture best practices](../Best-Practices/Module-Architecture.md) guide. + +## Installation + +TODO... \ No newline at end of file diff --git a/docs/en/Modules/Index.md b/docs/en/Modules/Index.md new file mode 100644 index 0000000000..9dc5da7a99 --- /dev/null +++ b/docs/en/Modules/Index.md @@ -0,0 +1,26 @@ +# Application Modules + +ABP is a **modular application framework** which consists of dozens of **nuget packages**. It also provides a complete infrastructure to build your own application modules which may have entities, services, database integration, APIs, UI components and so on. + +There are **two types of modules.** They don't have any structural difference but categorized by functionality and purpose: + +* [**Framework modules**](https://github.com/abpframework/abp/tree/master/framework/src): These are **core modules of the framework** like caching, emailing, theming, security, serialization, validation, EF Core integration, MongoDB integration... etc. They do not have application/business functionalities but makes your daily development easier by providing common infrastructure, integration and abstractions. +* [**Application modules**](https://github.com/abpframework/abp/tree/master/modules): These modules implement specific application/business functionalities like blogging, document management, identity management, tenant management... etc. They generally have their own entities, services, APIs and UI components. + +## Open Source Application Modules + +There are some **free and open source** application modules developed and maintained by the ABP community: + +* **Account**: Used to make user login/register to the application. +* **Audit Logging**: Used to persist audit logs to a database. +* **Background Jobs**: Used to persist background jobs when using default background job manager. +* **Blogging**: Used to create fancy blogs. ABP's [own blog](https://abp.io/blog/abp/) already using this module. +* [**Docs**](Docs.md): Used to create technical documentation pages. ABP's [own documentation](https://abp.io/documents/) already using this module. +* **Identity**: Used to manage roles, users and their permissions. +* **Identity Server**: Integrates to IdentityServer4. +* **Permission Management**: Used to persist permissions. +* **Setting Management**: Used to persist settings. +* **Tenant Management**: Used to manage tenants for a [multi-tenant](../Multi-Tenancy.md) application. +* **Users**: Used the abstract users, so other modules can depend on this instead of the Identity module. + +Documenting the modules is in the progress. See [this repository](https://github.com/abpframework/abp/tree/master/modules) for source code of all modules. \ No newline at end of file diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 1060a715fc..ff05d3934a 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -246,6 +246,10 @@ } ] }, + { + "text": "Application Modules", + "path": "Modules/Index.md" + }, { "text": "Testing" }, diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs index 820d098951..9a39a06dc2 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs @@ -39,8 +39,8 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore b.Property(x => x.UserName).HasMaxLength(AuditLogConsts.MaxUserNameLength).HasColumnName(nameof(AuditLog.UserName)); b.Property(x => x.TenantId).HasColumnName(nameof(AuditLog.TenantId)); - b.HasMany().WithOne().HasForeignKey(x => x.AuditLogId); - b.HasMany().WithOne().HasForeignKey(x => x.AuditLogId); + b.HasMany(a => a.Actions).WithOne().HasForeignKey(x => x.AuditLogId).IsRequired(); + b.HasMany(a => a.EntityChanges).WithOne().HasForeignKey(x => x.AuditLogId).IsRequired(); b.HasIndex(x => new { x.TenantId, x.ExecutionTime }); b.HasIndex(x => new { x.TenantId, x.UserId, x.ExecutionTime }); diff --git a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181212114934_Initial.Designer.cs b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.Designer.cs similarity index 99% rename from templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181212114934_Initial.Designer.cs rename to templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.Designer.cs index 9f8a2b4adf..3ab0c0721f 100644 --- a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181212114934_Initial.Designer.cs +++ b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.Designer.cs @@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.DemoApp; namespace MyCompanyName.MyProjectName.DemoApp.Migrations { [DbContext(typeof(DemoAppDbContext))] - [Migration("20181212114934_Initial")] + [Migration("20181218134206_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181212114934_Initial.cs b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.cs similarity index 100% rename from templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181212114934_Initial.cs rename to templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.cs diff --git a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj index c42f5f663c..2ec0453f90 100644 --- a/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj +++ b/templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj @@ -33,4 +33,8 @@ + + + + diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.Designer.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.Designer.cs similarity index 97% rename from templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.Designer.cs rename to templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.Designer.cs index 8afbe89363..7821feff86 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.Designer.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.Designer.cs @@ -11,7 +11,7 @@ using Volo.Abp.BackgroundJobs; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20181212113826_Initial")] + [Migration("20181218134025_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -101,8 +101,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ExecutionDuration") .HasColumnName("ExecutionDuration"); @@ -130,8 +128,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); b.ToTable("AbpAuditLogActions"); @@ -145,8 +141,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ChangeTime") .HasColumnName("ChangeTime"); @@ -173,8 +167,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); b.ToTable("AbpEntityChanges"); @@ -608,25 +600,17 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("Actions") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("Actions") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("EntityChanges") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.cs similarity index 95% rename from templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.cs rename to templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.cs index 5dd6559191..1f76a505a8 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.cs @@ -12,6 +12,7 @@ namespace MyCompanyName.MyProjectName.Migrations columns: table => new { Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), ConcurrencyStamp = table.Column(nullable: true), UserId = table.Column(nullable: true), UserName = table.Column(maxLength: 256, nullable: true), @@ -27,8 +28,7 @@ namespace MyCompanyName.MyProjectName.Migrations Url = table.Column(maxLength: 256, nullable: true), Exceptions = table.Column(maxLength: 4000, nullable: true), Comments = table.Column(maxLength: 256, nullable: true), - HttpStatusCode = table.Column(nullable: true), - ExtraProperties = table.Column(nullable: true) + HttpStatusCode = table.Column(nullable: true) }, constraints: table => { @@ -173,8 +173,7 @@ namespace MyCompanyName.MyProjectName.Migrations Parameters = table.Column(maxLength: 2000, nullable: true), ExecutionTime = table.Column(nullable: false), ExecutionDuration = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - AuditLogId1 = table.Column(nullable: true) + ExtraProperties = table.Column(nullable: true) }, constraints: table => { @@ -185,12 +184,6 @@ namespace MyCompanyName.MyProjectName.Migrations principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId1", - column: x => x.AuditLogId1, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -204,8 +197,7 @@ namespace MyCompanyName.MyProjectName.Migrations ChangeType = table.Column(nullable: false), EntityId = table.Column(maxLength: 128, nullable: false), EntityTypeFullName = table.Column(maxLength: 128, nullable: false), - ExtraProperties = table.Column(nullable: true), - AuditLogId1 = table.Column(nullable: true) + ExtraProperties = table.Column(nullable: true) }, constraints: table => { @@ -216,12 +208,6 @@ namespace MyCompanyName.MyProjectName.Migrations principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId1", - column: x => x.AuditLogId1, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -368,11 +354,6 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpAuditLogActions", column: "AuditLogId"); - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogActions_AuditLogId1", - table: "AbpAuditLogActions", - column: "AuditLogId1"); - migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime", table: "AbpAuditLogActions", @@ -398,11 +379,6 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpEntityChanges", column: "AuditLogId"); - migrationBuilder.CreateIndex( - name: "IX_AbpEntityChanges_AuditLogId1", - table: "AbpEntityChanges", - column: "AuditLogId1"); - migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", table: "AbpEntityChanges", diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs index 8a05ab5bc3..2ff93f8fde 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -99,8 +99,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ExecutionDuration") .HasColumnName("ExecutionDuration"); @@ -128,8 +126,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); b.ToTable("AbpAuditLogActions"); @@ -143,8 +139,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ChangeTime") .HasColumnName("ChangeTime"); @@ -171,8 +165,6 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); b.ToTable("AbpEntityChanges"); @@ -606,25 +598,17 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("Actions") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("Actions") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("EntityChanges") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj index c393a58161..877987ae14 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj +++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj @@ -7,6 +7,8 @@ + + diff --git a/templates/service/host/IdentityServerHost/IdentityServerHost.csproj b/templates/service/host/IdentityServerHost/IdentityServerHost.csproj index 5dc44682e9..f2b60aba11 100644 --- a/templates/service/host/IdentityServerHost/IdentityServerHost.csproj +++ b/templates/service/host/IdentityServerHost/IdentityServerHost.csproj @@ -25,4 +25,8 @@ + + + + diff --git a/templates/service/host/IdentityServerHost/Migrations/20181212121034_Initial.Designer.cs b/templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.Designer.cs similarity index 99% rename from templates/service/host/IdentityServerHost/Migrations/20181212121034_Initial.Designer.cs rename to templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.Designer.cs index 63b2af58a7..757aa9d169 100644 --- a/templates/service/host/IdentityServerHost/Migrations/20181212121034_Initial.Designer.cs +++ b/templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.Designer.cs @@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace IdentityServerHost.Migrations { [DbContext(typeof(DemoAppDbContext))] - [Migration("20181212121034_Initial")] + [Migration("20181218135354_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/templates/service/host/IdentityServerHost/Migrations/20181212121034_Initial.cs b/templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.cs similarity index 100% rename from templates/service/host/IdentityServerHost/Migrations/20181212121034_Initial.cs rename to templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.cs diff --git a/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.Designer.cs b/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.Designer.cs similarity index 94% rename from templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.Designer.cs rename to templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.Designer.cs index 1644e14900..67977b2f6a 100644 --- a/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.Designer.cs +++ b/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.Designer.cs @@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.Host; namespace MyCompanyName.MyProjectName.Host.Migrations { [DbContext(typeof(DemoAppDbContext))] - [Migration("20181212121232_Initial")] + [Migration("20181218135310_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -100,8 +100,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ExecutionDuration") .HasColumnName("ExecutionDuration"); @@ -129,8 +127,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); b.ToTable("AbpAuditLogActions"); @@ -144,8 +140,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ChangeTime") .HasColumnName("ChangeTime"); @@ -172,8 +166,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); b.ToTable("AbpEntityChanges"); @@ -272,25 +264,17 @@ namespace MyCompanyName.MyProjectName.Host.Migrations modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("Actions") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("Actions") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("EntityChanges") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => diff --git a/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.cs b/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.cs similarity index 89% rename from templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.cs rename to templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.cs index c191391cc9..fd1c985c5d 100644 --- a/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.cs +++ b/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.cs @@ -77,8 +77,7 @@ namespace MyCompanyName.MyProjectName.Host.Migrations Parameters = table.Column(maxLength: 2000, nullable: true), ExecutionTime = table.Column(nullable: false), ExecutionDuration = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - AuditLogId1 = table.Column(nullable: true) + ExtraProperties = table.Column(nullable: true) }, constraints: table => { @@ -89,12 +88,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId1", - column: x => x.AuditLogId1, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -108,8 +101,7 @@ namespace MyCompanyName.MyProjectName.Host.Migrations ChangeType = table.Column(nullable: false), EntityId = table.Column(maxLength: 128, nullable: false), EntityTypeFullName = table.Column(maxLength: 128, nullable: false), - ExtraProperties = table.Column(nullable: true), - AuditLogId1 = table.Column(nullable: true) + ExtraProperties = table.Column(nullable: true) }, constraints: table => { @@ -120,12 +112,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId1", - column: x => x.AuditLogId1, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -163,11 +149,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations table: "AbpAuditLogActions", column: "AuditLogId"); - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogActions_AuditLogId1", - table: "AbpAuditLogActions", - column: "AuditLogId1"); - migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime", table: "AbpAuditLogActions", @@ -188,11 +169,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations table: "AbpEntityChanges", column: "AuditLogId"); - migrationBuilder.CreateIndex( - name: "IX_AbpEntityChanges_AuditLogId1", - table: "AbpEntityChanges", - column: "AuditLogId1"); - migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", table: "AbpEntityChanges", diff --git a/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs b/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs index 69e2cc0ae2..c5e59b55fd 100644 --- a/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs +++ b/templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs @@ -98,8 +98,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ExecutionDuration") .HasColumnName("ExecutionDuration"); @@ -127,8 +125,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); b.ToTable("AbpAuditLogActions"); @@ -142,8 +138,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.Property("AuditLogId") .HasColumnName("AuditLogId"); - b.Property("AuditLogId1"); - b.Property("ChangeTime") .HasColumnName("ChangeTime"); @@ -170,8 +164,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.HasIndex("AuditLogId"); - b.HasIndex("AuditLogId1"); - b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); b.ToTable("AbpEntityChanges"); @@ -270,25 +262,17 @@ namespace MyCompanyName.MyProjectName.Host.Migrations modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("Actions") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("Actions") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany() + .WithMany("EntityChanges") .HasForeignKey("AuditLogId") .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId1"); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => diff --git a/templates/service/host/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj b/templates/service/host/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj index 979261471c..fb6d365ca6 100644 --- a/templates/service/host/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj +++ b/templates/service/host/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj @@ -30,4 +30,8 @@ + + + +