Browse Source

MVC template cleanup & refactor.

pull/1128/head
Halil ibrahim Kalkan 7 years ago
parent
commit
a740e4a2a5
  1. 2
      templates/mvc/.gitignore
  2. 5
      templates/mvc/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs
  3. 3
      templates/mvc/src/MyCompanyName.MyProjectName.Application/Permissions/MyProjectNamePermissions.cs
  4. 2
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj
  5. 12
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs
  6. 2
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs
  7. 30
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190515120718_Initial.Designer.cs
  8. 23
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190515120718_Initial.cs
  9. 28
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs
  10. 4
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj
  11. 4
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs
  12. 4
      templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs

2
templates/mvc/.gitignore

@ -252,4 +252,4 @@ paket-files/
*.sln.iml
# MyProjectName
src/MyCompanyName.MyProjectName.Web/Logs/logs.txt
src/MyCompanyName.MyProjectName.Web/Logs/*

5
templates/mvc/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs

@ -20,6 +20,11 @@ namespace MyCompanyName.MyProjectName
{
Configure<AbpAutoMapperOptions>(options =>
{
/* use `true` for the `validate` parameter if you want to
* validate the profile on application startup.
* See http://docs.automapper.org/en/stable/Configuration-validation.html for more
* about configuration validation.
*/
options.AddProfile<MyProjectNameApplicationAutoMapperProfile>();
});
}

3
templates/mvc/src/MyCompanyName.MyProjectName.Application/Permissions/MyProjectNamePermissions.cs

@ -1,5 +1,4 @@
using System;
using Volo.Abp.Reflection;
using Volo.Abp.Reflection;
namespace MyCompanyName.MyProjectName.Permissions
{

2
templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj

@ -14,7 +14,7 @@
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain\Volo.Abp.AuditLogging.Domain.csproj" />
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Domain\Volo.Abp.TenantManagement.Domain.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Domain\Volo.Abp.FeatureManagement.Domain.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Auditing\Volo.Abp.Auditing.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Domain\Volo.Abp.SettingManagement.Domain.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
</ItemGroup>

12
templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs

@ -1,5 +1,4 @@
using MyCompanyName.MyProjectName.Localization.MyProjectName;
using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.FeatureManagement;
@ -9,19 +8,20 @@ using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
using Volo.Abp.VirtualFileSystem;
namespace MyCompanyName.MyProjectName
{
[DependsOn(
typeof(AbpAuditLoggingDomainModule),
typeof(BackgroundJobsDomainModule),
typeof(AbpFeatureManagementDomainModule),
typeof(AbpIdentityDomainModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpAuditingModule),
typeof(BackgroundJobsDomainModule),
typeof(AbpAuditLoggingDomainModule),
typeof(AbpTenantManagementDomainModule),
typeof(AbpFeatureManagementDomainModule)
typeof(AbpSettingManagementDomainModule),
typeof(AbpTenantManagementDomainModule)
)]
public class MyProjectNameDomainModule : AbpModule
{

2
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs

@ -2,6 +2,7 @@
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.PermissionManagement.EntityFrameworkCore;
@ -29,6 +30,7 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement();
/* Configure customizations for entities from the modules included */

30
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190402131334_Initial.Designer.cs → templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190515120718_Initial.Designer.cs

@ -10,14 +10,14 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations
{
[DbContext(typeof(MyProjectNameMigrationsDbContext))]
[Migration("20190402131334_Initial")]
[Migration("20190515120718_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -265,6 +265,32 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("AbpBackgroundJobs");
});
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(128);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpFeatureValues");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")

23
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190402131334_Initial.cs → templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190515120718_Initial.cs

@ -80,6 +80,21 @@ namespace MyCompanyName.MyProjectName.Migrations
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpFeatureValues",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
@ -427,6 +442,11 @@ namespace MyCompanyName.MyProjectName.Migrations
table: "AbpEntityPropertyChanges",
column: "EntityChangeId");
migrationBuilder.CreateIndex(
name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey",
table: "AbpFeatureValues",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
@ -503,6 +523,9 @@ namespace MyCompanyName.MyProjectName.Migrations
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpFeatureValues");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");

28
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs

@ -15,7 +15,7 @@ namespace MyCompanyName.MyProjectName.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
@ -263,6 +263,32 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("AbpBackgroundJobs");
});
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(128);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpFeatureValues");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")

4
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj

@ -7,10 +7,6 @@
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\20190320072839_Initial.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj" />
</ItemGroup>

4
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs

@ -28,7 +28,9 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
context.Services.AddAbpDbContext<MyProjectNameDbContext>(options =>
{
//Remove "includeAllEntities: true" to create default repositories only for aggregate roots
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots
*/
options.AddDefaultRepositories(includeAllEntities: true);
});
}

4
templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs

@ -16,7 +16,9 @@ namespace MyCompanyName.MyProjectName.MongoDb
modelBuilder.Entity<AppUser>(b =>
{
b.CollectionName = "AbpUsers"; //Sharing the same collection "AbpUsers" with the IdentityUser
/* Sharing the same "AbpUsers" collection with the Identity module (IdentityUser entity).
*/
b.CollectionName = "AbpUsers";
});
}
}

Loading…
Cancel
Save