diff --git a/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln b/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln
index 5136e6c039..c899ac4b70 100644
--- a/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln
+++ b/templates/app/aspnet-core/MyCompanyName.MyProjectName.sln
@@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.MongoDB", "src\MyCompanyName.MyProjectName.MongoDB\MyCompanyName.MyProjectName.MongoDB.csproj", "{E3444355-D47E-431E-BDD0-DD3A7113B2AE}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations", "src\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj", "{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Domain.Shared", "src\MyCompanyName.MyProjectName.Domain.Shared\MyCompanyName.MyProjectName.Domain.Shared.csproj", "{42F719ED-8413-4895-B5B4-5AB56079BC66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Application.Contracts", "src\MyCompanyName.MyProjectName.Application.Contracts\MyCompanyName.MyProjectName.Application.Contracts.csproj", "{520659C8-C734-4298-A3DA-B539DB9DFC0B}"
@@ -91,10 +89,6 @@ Global
{E3444355-D47E-431E-BDD0-DD3A7113B2AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3444355-D47E-431E-BDD0-DD3A7113B2AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3444355-D47E-431E-BDD0-DD3A7113B2AE}.Release|Any CPU.Build.0 = Release|Any CPU
- {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.Build.0 = Release|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -175,7 +169,6 @@ Global
{50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{E3444355-D47E-431E-BDD0-DD3A7113B2AE} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
- {0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{42F719ED-8413-4895-B5B4-5AB56079BC66} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{520659C8-C734-4298-A3DA-B539DB9DFC0B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj
index 41b06f939f..dd2c98bf78 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj
@@ -23,7 +23,7 @@
-
+
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs
index 1120f5ab0e..2695f04952 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs
@@ -46,7 +46,7 @@ namespace MyCompanyName.MyProjectName.Blazor.Server
{
[DependsOn(
typeof(MyProjectNameApplicationModule),
- typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
+ typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(MyProjectNameHttpApiModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAutofacModule),
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj
index 471cab6cda..2466e0d019 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj
@@ -28,9 +28,9 @@
-
+
-
+
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs
index ed9e67651c..44e0157e68 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs
@@ -7,7 +7,7 @@ namespace MyCompanyName.MyProjectName.DbMigrator
{
[DependsOn(
typeof(AbpAutofacModule),
- typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
+ typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(MyProjectNameApplicationContractsModule)
)]
public class MyProjectNameDbMigratorModule : AbpModule
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs
deleted file mode 100644
index 1b5b3996ee..0000000000
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using Volo.Abp.Domain.Entities.Auditing;
-using Volo.Abp.Users;
-
-namespace MyCompanyName.MyProjectName.Users
-{
- /* This entity shares the same table/collection ("AbpUsers" by default) with the
- * IdentityUser entity of the Identity module.
- *
- * - You can define your custom properties into this class.
- * - You never create or delete this entity, because it is Identity module's job.
- * - You can query users from database with this entity.
- * - You can update values of your custom properties.
- */
- public class AppUser : FullAuditedAggregateRoot, IUser
- {
- #region Base properties
-
- /* These properties are shared with the IdentityUser entity of the Identity module.
- * Do not change these properties through this class. Instead, use Identity module
- * services (like IdentityUserManager) to change them.
- * So, this properties are designed as read only!
- */
-
- public virtual Guid? TenantId { get; private set; }
-
- public virtual string UserName { get; private set; }
-
- public virtual string Name { get; private set; }
-
- public virtual string Surname { get; private set; }
-
- public virtual string Email { get; private set; }
-
- public virtual bool EmailConfirmed { get; private set; }
-
- public virtual string PhoneNumber { get; private set; }
-
- public virtual bool PhoneNumberConfirmed { get; private set; }
-
- #endregion
-
- /* Add your own properties here. Example:
- *
- * public string MyProperty { get; set; }
- *
- * If you add a property and using the EF Core, remember these;
- *
- * 1. Update MyProjectNameDbContext.OnModelCreating
- * to configure the mapping for your new property
- * 2. Update MyProjectNameEfCoreEntityExtensionMappings to extend the IdentityUser entity
- * and add your new property to the migration.
- * 3. Use the Add-Migration to add a new database migration.
- * 4. Run the .DbMigrator project (or use the Update-Database command) to apply
- * schema change to the database.
- */
-
- private AppUser()
- {
-
- }
- }
-}
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreDbMigrationsModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreDbMigrationsModule.cs
deleted file mode 100644
index ed9d6dfb08..0000000000
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreDbMigrationsModule.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using Volo.Abp.Modularity;
-
-namespace MyCompanyName.MyProjectName.EntityFrameworkCore
-{
- [DependsOn(
- typeof(MyProjectNameEntityFrameworkCoreModule)
- )]
- public class MyProjectNameEntityFrameworkCoreDbMigrationsModule : AbpModule
- {
- public override void ConfigureServices(ServiceConfigurationContext context)
- {
- context.Services.AddAbpDbContext();
- }
- }
-}
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs
deleted file mode 100644
index 13e6fdac87..0000000000
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using Microsoft.EntityFrameworkCore;
-using Volo.Abp.AuditLogging.EntityFrameworkCore;
-using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
-using Volo.Abp.EntityFrameworkCore;
-using Volo.Abp.FeatureManagement.EntityFrameworkCore;
-using Volo.Abp.Identity;
-using Volo.Abp.Identity.EntityFrameworkCore;
-using Volo.Abp.IdentityServer.EntityFrameworkCore;
-using Volo.Abp.PermissionManagement.EntityFrameworkCore;
-using Volo.Abp.SettingManagement.EntityFrameworkCore;
-using Volo.Abp.TenantManagement.EntityFrameworkCore;
-
-namespace MyCompanyName.MyProjectName.EntityFrameworkCore
-{
- /* This DbContext is only used for database migrations.
- * It is not used on runtime. See MyProjectNameDbContext for the runtime DbContext.
- * It is a unified model that includes configuration for
- * all used modules and your application.
- */
- public class MyProjectNameMigrationsDbContext : AbpDbContext
- {
- public MyProjectNameMigrationsDbContext(DbContextOptions options)
- : base(options)
- {
-
- }
-
- protected override void OnModelCreating(ModelBuilder builder)
- {
- base.OnModelCreating(builder);
-
- /* Include modules to your migration db context */
-
- builder.ConfigurePermissionManagement();
- builder.ConfigureSettingManagement();
- builder.ConfigureBackgroundJobs();
- builder.ConfigureAuditLogging();
- builder.ConfigureIdentity();
- builder.ConfigureIdentityServer();
- builder.ConfigureFeatureManagement();
- builder.ConfigureTenantManagement();
-
- /* Configure your own tables/entities inside the ConfigureMyProjectName method */
-
- builder.ConfigureMyProjectName();
- }
- }
-}
\ No newline at end of file
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj
deleted file mode 100644
index 26ae8ce6c3..0000000000
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
- net5.0
- MyCompanyName.MyProjectName
-
-
-
-
-
-
-
-
- runtime; build; native; contentfiles; analyzers
- compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native
-
-
-
-
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EntityFrameworkCoreMyProjectNameDbSchemaMigrator.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreMyProjectNameDbSchemaMigrator.cs
similarity index 86%
rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EntityFrameworkCoreMyProjectNameDbSchemaMigrator.cs
rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreMyProjectNameDbSchemaMigrator.cs
index 752e0e18b3..45fb944a73 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EntityFrameworkCoreMyProjectNameDbSchemaMigrator.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreMyProjectNameDbSchemaMigrator.cs
@@ -20,16 +20,16 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
public async Task MigrateAsync()
{
- /* We intentionally resolving the MyProjectNameMigrationsDbContext
+ /* We intentionally resolving the MyProjectNameDbContext
* from IServiceProvider (instead of directly injecting it)
* to properly get the connection string of the current tenant in the
* current scope.
*/
await _serviceProvider
- .GetRequiredService()
+ .GetRequiredService()
.Database
.MigrateAsync();
}
}
-}
\ No newline at end of file
+}
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
index e1478119be..43baa25f5a 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
@@ -1,29 +1,21 @@
using Microsoft.EntityFrameworkCore;
-using MyCompanyName.MyProjectName.Users;
+using Volo.Abp.AuditLogging.EntityFrameworkCore;
+using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
-using Volo.Abp.EntityFrameworkCore.Modeling;
-using Volo.Abp.Identity;
-using Volo.Abp.Users.EntityFrameworkCore;
+using Volo.Abp.FeatureManagement.EntityFrameworkCore;
+using Volo.Abp.Identity.EntityFrameworkCore;
+using Volo.Abp.IdentityServer.EntityFrameworkCore;
+using Volo.Abp.PermissionManagement.EntityFrameworkCore;
+using Volo.Abp.SettingManagement.EntityFrameworkCore;
+using Volo.Abp.TenantManagement.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
- /* This is your actual DbContext used on runtime.
- * It includes only your entities.
- * It does not include entities of the used modules, because each module has already
- * its own DbContext class. If you want to share some database tables with the used modules,
- * just create a structure like done for AppUser.
- *
- * Don't use this DbContext for database migrations since it does not contain tables of the
- * used modules (as explained above). See MyProjectNameMigrationsDbContext for migrations.
- */
[ConnectionStringName("Default")]
public class MyProjectNameDbContext : AbpDbContext
{
- public DbSet Users { get; set; }
-
/* Add DbSet properties for your Aggregate Roots / Entities here.
- * Also map them inside MyProjectNameDbContextModelCreatingExtensions.ConfigureMyProjectName
*/
public MyProjectNameDbContext(DbContextOptions options)
@@ -36,23 +28,25 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
base.OnModelCreating(builder);
- /* Configure the shared tables (with included modules) here */
-
- builder.Entity(b =>
- {
- b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "Users"); //Sharing the same table "AbpUsers" with the IdentityUser
-
- b.ConfigureByConvention();
- b.ConfigureAbpUser();
-
- /* Configure mappings for your additional properties
- * Also see the MyProjectNameEfCoreEntityExtensionMappings class
- */
- });
-
- /* Configure your own tables/entities inside the ConfigureMyProjectName method */
-
- builder.ConfigureMyProjectName();
+ /* Include modules to your migration db context */
+
+ builder.ConfigurePermissionManagement();
+ builder.ConfigureSettingManagement();
+ builder.ConfigureBackgroundJobs();
+ builder.ConfigureAuditLogging();
+ builder.ConfigureIdentity();
+ builder.ConfigureIdentityServer();
+ builder.ConfigureFeatureManagement();
+ builder.ConfigureTenantManagement();
+
+ /* Configure your own tables/entities inside here */
+
+ //builder.Entity(b =>
+ //{
+ // b.ToTable(MyProjectNameConsts.DbTablePrefix + "YourEntities", MyProjectNameConsts.DbSchema);
+ // b.ConfigureByConvention(); //auto configure for the base class props
+ // //...
+ //});
}
}
}
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContextFactory.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
similarity index 76%
rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContextFactory.cs
rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
index 6d08ae674f..139a723f34 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContextFactory.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
@@ -7,18 +7,18 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
/* This class is needed for EF Core console commands
* (like Add-Migration and Update-Database commands) */
- public class MyProjectNameMigrationsDbContextFactory : IDesignTimeDbContextFactory
+ public class MyProjectNameDbContextFactory : IDesignTimeDbContextFactory
{
- public MyProjectNameMigrationsDbContext CreateDbContext(string[] args)
+ public MyProjectNameDbContext CreateDbContext(string[] args)
{
MyProjectNameEfCoreEntityExtensionMappings.Configure();
var configuration = BuildConfiguration();
- var builder = new DbContextOptionsBuilder()
+ var builder = new DbContextOptionsBuilder()
.UseSqlServer(configuration.GetConnectionString("Default"));
- return new MyProjectNameMigrationsDbContext(builder.Options);
+ return new MyProjectNameDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs
deleted file mode 100644
index dbc3805f25..0000000000
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Microsoft.EntityFrameworkCore;
-using Volo.Abp;
-
-namespace MyCompanyName.MyProjectName.EntityFrameworkCore
-{
- public static class MyProjectNameDbContextModelCreatingExtensions
- {
- public static void ConfigureMyProjectName(this ModelBuilder builder)
- {
- Check.NotNull(builder, nameof(builder));
-
- /* Configure your own tables/entities inside here */
-
- //builder.Entity(b =>
- //{
- // b.ToTable(MyProjectNameConsts.DbTablePrefix + "YourEntities", MyProjectNameConsts.DbSchema);
- // b.ConfigureByConvention(); //auto configure for the base class props
- // //...
- //});
- }
- }
-}
\ No newline at end of file
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20210324094537_Initial.Designer.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20210531084225_Initial.Designer.cs
similarity index 99%
rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20210324094537_Initial.Designer.cs
rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20210531084225_Initial.Designer.cs
index 8c8077902d..48b67399a1 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20210324094537_Initial.Designer.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20210531084225_Initial.Designer.cs
@@ -10,8 +10,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
- [DbContext(typeof(MyProjectNameMigrationsDbContext))]
- [Migration("20210324094537_Initial")]
+ [DbContext(typeof(MyProjectNameDbContext))]
+ [Migration("20210531084225_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -20,7 +20,7 @@ namespace MyCompanyName.MyProjectName.Migrations
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("Relational:MaxIdentifierLength", 128)
- .HasAnnotation("ProductVersion", "5.0.4")
+ .HasAnnotation("ProductVersion", "5.0.6")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20210324094537_Initial.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20210531084225_Initial.cs
similarity index 100%
rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20210324094537_Initial.cs
rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20210531084225_Initial.cs
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs
similarity index 99%
rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs
rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs
index c4ab591bd1..3612ae96a4 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs
@@ -9,8 +9,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
- [DbContext(typeof(MyProjectNameMigrationsDbContext))]
- partial class MyProjectNameMigrationsDbContextModelSnapshot : ModelSnapshot
+ [DbContext(typeof(MyProjectNameDbContext))]
+ partial class MyProjectNameDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
@@ -18,7 +18,7 @@ namespace MyCompanyName.MyProjectName.Migrations
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("Relational:MaxIdentifierLength", 128)
- .HasAnnotation("ProductVersion", "5.0.4")
+ .HasAnnotation("ProductVersion", "5.0.6")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
index 35238c49f0..32f6d5171b 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
@@ -20,4 +20,11 @@
+
+
+ runtime; build; native; contentfiles; analyzers
+ compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native
+
+
+
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
index ec64f8b082..88f8e020b7 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
@@ -23,7 +23,7 @@
-
+
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 fb7435d447..88e16a4d3a 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
@@ -35,7 +35,7 @@ namespace MyCompanyName.MyProjectName
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(MyProjectNameApplicationModule),
- typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
+ typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
)]
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 b24dc50c4e..7710accedd 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
@@ -23,7 +23,7 @@
-
+
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 cd696da65f..aceaa36d7f 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
@@ -36,7 +36,7 @@ namespace MyCompanyName.MyProjectName
typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMultiTenancyModule),
typeof(MyProjectNameApplicationModule),
- typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
+ typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAccountWebIdentityServerModule),
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
index 56210d82ff..06cbb12cc3 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
@@ -44,7 +44,7 @@
-
+
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
index 843cf53e47..f28e487b1b 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
@@ -40,7 +40,7 @@ namespace MyCompanyName.MyProjectName
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAccountApplicationModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
- typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
+ typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule)
)]
public class MyProjectNameIdentityServerModule : AbpModule
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs
index b2f8334f92..c034bf5768 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs
@@ -1,6 +1,4 @@
-using MongoDB.Driver;
-using MyCompanyName.MyProjectName.Users;
-using Volo.Abp.Data;
+using Volo.Abp.Data;
using Volo.Abp.MongoDB;
namespace MyCompanyName.MyProjectName.MongoDB
@@ -8,18 +6,18 @@ namespace MyCompanyName.MyProjectName.MongoDB
[ConnectionStringName("Default")]
public class MyProjectNameMongoDbContext : AbpMongoDbContext
{
- public IMongoCollection Users => Collection();
+ /* Add mongo collections here. Example:
+ * public IMongoCollection Questions => Collection();
+ */
protected override void CreateModel(IMongoModelBuilder modelBuilder)
{
base.CreateModel(modelBuilder);
- modelBuilder.Entity(b =>
- {
- /* Sharing the same "AbpUsers" collection
- * with the Identity module's IdentityUser class. */
- b.CollectionName = "AbpUsers";
- });
+ //builder.Entity(b =>
+ //{
+ // //...
+ //});
}
}
}
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
index 56ec66098c..6814029396 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
@@ -39,7 +39,7 @@
-
+
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs
index ad2fbad18d..7658f8e867 100644
--- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs
+++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs
@@ -43,7 +43,7 @@ namespace MyCompanyName.MyProjectName.Web
[DependsOn(
typeof(MyProjectNameHttpApiModule),
typeof(MyProjectNameApplicationModule),
- typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
+ typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(AbpAutofacModule),
typeof(AbpIdentityWebModule),
typeof(AbpSettingManagementWebModule),
diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
index ca28d11863..147d01a098 100644
--- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
+++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
@@ -11,7 +11,7 @@ using Volo.Abp.Modularity;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
[DependsOn(
- typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
+ typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(MyProjectNameTestBaseModule),
typeof(AbpEntityFrameworkCoreSqliteModule)
)]
@@ -47,11 +47,11 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
var connection = new SqliteConnection("Data Source=:memory:");
connection.Open();
- var options = new DbContextOptionsBuilder()
+ var options = new DbContextOptionsBuilder()
.UseSqlite(connection)
.Options;
- using (var context = new MyProjectNameMigrationsDbContext(options))
+ using (var context = new MyProjectNameDbContext(options))
{
context.GetService().CreateTables();
}
diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs
index 3fdaa28ea7..fb69be6a1e 100644
--- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs
+++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs
@@ -1,10 +1,10 @@
using Microsoft.EntityFrameworkCore;
-using MyCompanyName.MyProjectName.Users;
using Shouldly;
using System;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
+using Volo.Abp.Identity;
using Xunit;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore.Samples
@@ -17,11 +17,11 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore.Samples
[Collection(MyProjectNameTestConsts.CollectionDefinitionName)]
public class SampleRepositoryTests : MyProjectNameEntityFrameworkCoreTestBase
{
- private readonly IRepository _appUserRepository;
+ private readonly IRepository _appUserRepository;
public SampleRepositoryTests()
{
- _appUserRepository = GetRequiredService>();
+ _appUserRepository = GetRequiredService>();
}
[Fact]
diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj
index dcbb7fe3a6..fc14ea5a7f 100644
--- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj
+++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/Samples/SampleRepositoryTests.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/Samples/SampleRepositoryTests.cs
index 0c45d0a52e..7d3f8ebc47 100644
--- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/Samples/SampleRepositoryTests.cs
+++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/Samples/SampleRepositoryTests.cs
@@ -1,9 +1,9 @@
using System;
using System.Threading.Tasks;
-using MyCompanyName.MyProjectName.Users;
using MongoDB.Driver.Linq;
using Shouldly;
using Volo.Abp.Domain.Repositories;
+using Volo.Abp.Identity;
using Xunit;
namespace MyCompanyName.MyProjectName.MongoDB.Samples
@@ -16,11 +16,11 @@ namespace MyCompanyName.MyProjectName.MongoDB.Samples
[Collection(MyProjectNameTestConsts.CollectionDefinitionName)]
public class SampleRepositoryTests : MyProjectNameMongoDbTestBase
{
- private readonly IRepository _appUserRepository;
+ private readonly IRepository _appUserRepository;
public SampleRepositoryTests()
{
- _appUserRepository = GetRequiredService>();
+ _appUserRepository = GetRequiredService>();
}
[Fact]