diff --git a/samples/BookStore/.gitignore b/samples/BookStore/.gitignore
index 78d93c60d8..5e2a431b54 100644
--- a/samples/BookStore/.gitignore
+++ b/samples/BookStore/.gitignore
@@ -252,4 +252,7 @@ paket-files/
*.sln.iml
# BookStore
-src/Acme.BookStore.Web/Logs/logs.txt
+src/Acme.BookStore.Web/Logs/*
+src/Acme.BookStore.Web.Host/Logs/*
+src/Acme.BookStore.IdentityServer/Logs/*
+src/Acme.BookStore.HttpApi.Host/Logs/*
\ No newline at end of file
diff --git a/samples/BookStore/Acme.BookStore.sln b/samples/BookStore/Acme.BookStore.sln
index 74836646a2..1de66eeb59 100644
--- a/samples/BookStore/Acme.BookStore.sln
+++ b/samples/BookStore/Acme.BookStore.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27703.1
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.28922.388
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.Domain", "src\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}"
EndProject
@@ -19,7 +19,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.Application.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.Web.Tests", "test\Acme.BookStore.Web.Tests\Acme.BookStore.Web.Tests.csproj", "{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acme.BookStore.EntityFrameworkCore.DbMigrations", "src\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj", "{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.EntityFrameworkCore.DbMigrations", "src\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj", "{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.Domain.Shared", "src\Acme.BookStore.Domain.Shared\Acme.BookStore.Domain.Shared.csproj", "{42F719ED-8413-4895-B5B4-5AB56079BC66}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.Application.Contracts", "src\Acme.BookStore.Application.Contracts\Acme.BookStore.Application.Contracts.csproj", "{520659C8-C734-4298-A3DA-B539DB9DFC0B}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.HttpApi", "src\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.csproj", "{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.HttpApi.Client", "src\Acme.BookStore.HttpApi.Client\Acme.BookStore.HttpApi.Client.csproj", "{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.EntityFrameworkCore.Tests", "test\Acme.BookStore.EntityFrameworkCore.Tests\Acme.BookStore.EntityFrameworkCore.Tests.csproj", "{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.TestBase", "test\Acme.BookStore.TestBase\Acme.BookStore.TestBase.csproj", "{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.Domain.Tests", "test\Acme.BookStore.Domain.Tests\Acme.BookStore.Domain.Tests.csproj", "{E512F4D9-9375-480F-A2F6-A46509F9D824}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.HttpApi.Client.ConsoleTestApp", "test\Acme.BookStore.HttpApi.Client.ConsoleTestApp\Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj", "{EF480016-9127-4916-8735-D2466BDBC582}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acme.BookStore.DbMigrator", "src\Acme.BookStore.DbMigrator\Acme.BookStore.DbMigrator.csproj", "{AA94D832-1CCC-4715-95A9-A483F23A1A5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -55,6 +73,42 @@ Global
{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
+ {42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.Build.0 = Release|Any CPU
+ {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.Build.0 = Release|Any CPU
+ {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -67,6 +121,15 @@ Global
{50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{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}
+ {3B5A0094-670D-4BB1-BFDD-61B88A8773DC} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
+ {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
+ {91853F21-9CD9-4132-BC29-A7D5D84FFFE7} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
+ {E512F4D9-9375-480F-A2F6-A46509F9D824} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
+ {EF480016-9127-4916-8735-D2466BDBC582} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
+ {AA94D832-1CCC-4715-95A9-A483F23A1A5D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
diff --git a/samples/BookStore/common.props b/samples/BookStore/common.props
index 771bc6bd29..7585f303ba 100644
--- a/samples/BookStore/common.props
+++ b/samples/BookStore/common.props
@@ -1,7 +1,7 @@
latest
- 0.16.0
+ 1.0.0
$(NoWarn);CS1591
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj b/samples/BookStore/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj
new file mode 100644
index 0000000000..f08af2efac
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj
@@ -0,0 +1,21 @@
+
+
+
+
+
+ netstandard2.0
+ Acme.BookStore
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/BookStore/src/Acme.BookStore.Application/BookDto.cs b/samples/BookStore/src/Acme.BookStore.Application.Contracts/BookDto.cs
similarity index 84%
rename from samples/BookStore/src/Acme.BookStore.Application/BookDto.cs
rename to samples/BookStore/src/Acme.BookStore.Application.Contracts/BookDto.cs
index 42581b95fb..5a94fbce1e 100644
--- a/samples/BookStore/src/Acme.BookStore.Application/BookDto.cs
+++ b/samples/BookStore/src/Acme.BookStore.Application.Contracts/BookDto.cs
@@ -1,10 +1,8 @@
using System;
using Volo.Abp.Application.Dtos;
-using Volo.Abp.AutoMapper;
namespace Acme.BookStore
{
- [AutoMapFrom(typeof(Book))]
public class BookDto : AuditedEntityDto
{
public string Name { get; set; }
diff --git a/samples/BookStore/src/Acme.BookStore.Application.Contracts/BookStoreApplicationContractsModule.cs b/samples/BookStore/src/Acme.BookStore.Application.Contracts/BookStoreApplicationContractsModule.cs
new file mode 100644
index 0000000000..f8af658d37
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Application.Contracts/BookStoreApplicationContractsModule.cs
@@ -0,0 +1,20 @@
+using Volo.Abp.FeatureManagement;
+using Volo.Abp.Identity;
+using Volo.Abp.Modularity;
+using Volo.Abp.PermissionManagement;
+using Volo.Abp.TenantManagement;
+
+namespace Acme.BookStore
+{
+ [DependsOn(
+ typeof(BookStoreDomainSharedModule),
+ typeof(AbpFeatureManagementApplicationContractsModule),
+ typeof(AbpIdentityApplicationContractsModule),
+ typeof(AbpPermissionManagementApplicationContractsModule),
+ typeof(AbpTenantManagementApplicationContractsModule)
+ )]
+ public class BookStoreApplicationContractsModule : AbpModule
+ {
+
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.Application/CreateUpdateBookDto.cs b/samples/BookStore/src/Acme.BookStore.Application.Contracts/CreateUpdateBookDto.cs
similarity index 79%
rename from samples/BookStore/src/Acme.BookStore.Application/CreateUpdateBookDto.cs
rename to samples/BookStore/src/Acme.BookStore.Application.Contracts/CreateUpdateBookDto.cs
index 0d5dae71cb..8dc38a9e31 100644
--- a/samples/BookStore/src/Acme.BookStore.Application/CreateUpdateBookDto.cs
+++ b/samples/BookStore/src/Acme.BookStore.Application.Contracts/CreateUpdateBookDto.cs
@@ -1,11 +1,8 @@
using System;
using System.ComponentModel.DataAnnotations;
-using Volo.Abp.AutoMapper;
namespace Acme.BookStore
{
- [AutoMapTo(typeof(Book))]
- [AutoMapFrom(typeof(BookDto))]
public class CreateUpdateBookDto
{
[Required]
@@ -14,10 +11,10 @@ namespace Acme.BookStore
[Required]
public BookType Type { get; set; } = BookType.Undefined;
-
+
[Required]
public DateTime PublishDate { get; set; }
-
+
[Required]
public float Price { get; set; }
}
diff --git a/samples/BookStore/src/Acme.BookStore.Application/IBookAppService.cs b/samples/BookStore/src/Acme.BookStore.Application.Contracts/IBookAppService.cs
similarity index 100%
rename from samples/BookStore/src/Acme.BookStore.Application/IBookAppService.cs
rename to samples/BookStore/src/Acme.BookStore.Application.Contracts/IBookAppService.cs
diff --git a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
index d7983e8b87..4b924ed040 100644
--- a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
+++ b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
@@ -1,4 +1,4 @@
-
+
@@ -9,6 +9,10 @@
+
+
+
+
diff --git a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs
index 2d1a44a8c5..9bc08930cf 100644
--- a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs
+++ b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationAutoMapperProfile.cs
@@ -6,7 +6,8 @@ namespace Acme.BookStore
{
public BookStoreApplicationAutoMapperProfile()
{
- //Configure your AutoMapper mapping configuration here...
+ CreateMap();
+ CreateMap();
}
}
}
diff --git a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs
index 4203ef0ccd..a97917f774 100644
--- a/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs
+++ b/samples/BookStore/src/Acme.BookStore.Application/BookStoreApplicationModule.cs
@@ -9,6 +9,7 @@ namespace Acme.BookStore
{
[DependsOn(
typeof(BookStoreDomainModule),
+ typeof(BookStoreApplicationContractsModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpTenantManagementApplicationModule),
@@ -20,6 +21,10 @@ namespace Acme.BookStore
{
Configure(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 info
+ * about the configuration validation. */
options.AddProfile();
});
}
diff --git a/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissionDefinitionProvider.cs b/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissionDefinitionProvider.cs
index 9a3c6bf18f..aaf784e56e 100644
--- a/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissionDefinitionProvider.cs
+++ b/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissionDefinitionProvider.cs
@@ -1,4 +1,4 @@
-using Acme.BookStore.Localization.BookStore;
+using Acme.BookStore.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
diff --git a/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissions.cs b/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissions.cs
index b1ec575904..b05c4883bd 100644
--- a/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissions.cs
+++ b/samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissions.cs
@@ -1,6 +1,4 @@
-using System;
-
-namespace Acme.BookStore.Permissions
+namespace Acme.BookStore.Permissions
{
public static class BookStorePermissions
{
@@ -8,11 +6,5 @@ namespace Acme.BookStore.Permissions
//Add your own permission names. Example:
//public const string MyPermission1 = GroupName + ".MyPermission1";
-
- public static string[] GetAll()
- {
- //Return an array of all permissions
- return Array.Empty();
- }
}
}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj b/samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj
new file mode 100644
index 0000000000..7df37ca0a7
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj
@@ -0,0 +1,34 @@
+
+
+
+
+
+ Exe
+ netcoreapp2.2
+
+
+
+
+
+
+
+
+ PreserveNewest
+ Always
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/BookStore/src/Acme.BookStore.DbMigrator/BookStoreDbMigratorModule.cs b/samples/BookStore/src/Acme.BookStore.DbMigrator/BookStoreDbMigratorModule.cs
new file mode 100644
index 0000000000..26b843d34c
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.DbMigrator/BookStoreDbMigratorModule.cs
@@ -0,0 +1,16 @@
+using Acme.BookStore.EntityFrameworkCore;
+using Volo.Abp.Autofac;
+using Volo.Abp.Modularity;
+
+namespace Acme.BookStore.DbMigrator
+{
+ [DependsOn(
+ typeof(AbpAutofacModule),
+ typeof(BookStoreEntityFrameworkCoreDbMigrationsModule),
+ typeof(BookStoreApplicationContractsModule)
+ )]
+ public class BookStoreDbMigratorModule : AbpModule
+ {
+
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.DbMigrator/Program.cs b/samples/BookStore/src/Acme.BookStore.DbMigrator/Program.cs
new file mode 100644
index 0000000000..d3c4034c8a
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.DbMigrator/Program.cs
@@ -0,0 +1,53 @@
+using System.IO;
+using Microsoft.Extensions.DependencyInjection;
+using Acme.BookStore.Data;
+using Serilog;
+using Serilog.Events;
+using Volo.Abp;
+using Volo.Abp.Threading;
+
+namespace Acme.BookStore.DbMigrator
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ ConfigureLogging();
+
+ using (var application = AbpApplicationFactory.Create(options =>
+ {
+ options.UseAutofac();
+ options.Services.AddLogging(c => c.AddSerilog());
+ }))
+ {
+ application.Initialize();
+
+ AsyncHelper.RunSync(
+ () => application
+ .ServiceProvider
+ .GetRequiredService()
+ .MigrateAsync()
+ );
+
+ application.Shutdown();
+ }
+ }
+
+ private static void ConfigureLogging()
+ {
+ Log.Logger = new LoggerConfiguration()
+ .MinimumLevel.Information()
+ .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
+ .MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning)
+#if DEBUG
+ .MinimumLevel.Override("Acme.BookStore", LogEventLevel.Debug)
+#else
+ .MinimumLevel.Override("Acme.BookStore", LogEventLevel.Information)
+#endif
+ .Enrich.FromLogContext()
+ .WriteTo.File(Path.Combine(Directory.GetCurrentDirectory(), "Logs/logs.txt"))
+ .WriteTo.Console()
+ .CreateLogger();
+ }
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.DbMigrator/appsettings.json b/samples/BookStore/src/Acme.BookStore.DbMigrator/appsettings.json
new file mode 100644
index 0000000000..05d7313b10
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.DbMigrator/appsettings.json
@@ -0,0 +1,16 @@
+{
+ "ConnectionStrings": {
+ "Default": "Server=localhost;Database=BookStore;Trusted_Connection=True;MultipleActiveResultSets=true"
+ },
+ "IdentityServer": {
+ "Clients": {
+ "BookStore_Web": {
+ "ClientId": "BookStore_Web",
+ "RootUrl": "https://localhost:44314/"
+ },
+ "BookStore_ConsoleTestApp": {
+ "ClientId": "BookStore_ConsoleTestApp"
+ }
+ }
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj
new file mode 100644
index 0000000000..aba9ffbd3a
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj
@@ -0,0 +1,26 @@
+
+
+
+
+
+ netstandard2.0
+ Acme.BookStore
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainErrorCodes.cs b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainErrorCodes.cs
new file mode 100644
index 0000000000..30f124fbed
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainErrorCodes.cs
@@ -0,0 +1,7 @@
+namespace Acme.BookStore
+{
+ public static class BookStoreDomainErrorCodes
+ {
+ /* You can add your business exception error codes here, as constants */
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs
new file mode 100644
index 0000000000..f0a6ad7964
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs
@@ -0,0 +1,45 @@
+using Acme.BookStore.Localization;
+using Volo.Abp.AuditLogging;
+using Volo.Abp.BackgroundJobs;
+using Volo.Abp.FeatureManagement;
+using Volo.Abp.Identity;
+using Volo.Abp.IdentityServer;
+using Volo.Abp.Localization;
+using Volo.Abp.Localization.Resources.AbpValidation;
+using Volo.Abp.Modularity;
+using Volo.Abp.PermissionManagement;
+using Volo.Abp.SettingManagement;
+using Volo.Abp.TenantManagement;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Acme.BookStore
+{
+ [DependsOn(
+ typeof(AbpAuditLoggingDomainSharedModule),
+ typeof(BackgroundJobsDomainSharedModule),
+ typeof(AbpFeatureManagementDomainSharedModule),
+ typeof(AbpIdentityDomainSharedModule),
+ typeof(AbpIdentityServerDomainSharedModule),
+ typeof(AbpPermissionManagementDomainSharedModule),
+ typeof(AbpSettingManagementDomainSharedModule),
+ typeof(AbpTenantManagementDomainSharedModule)
+ )]
+ public class BookStoreDomainSharedModule : AbpModule
+ {
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ Configure(options =>
+ {
+ options.FileSets.AddEmbedded("Acme.BookStore");
+ });
+
+ Configure(options =>
+ {
+ options.Resources
+ .Add("en")
+ .AddBaseTypes(typeof(AbpValidationResource))
+ .AddVirtualJson("/Localization/BookStore");
+ });
+ }
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/BookType.cs b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookType.cs
similarity index 78%
rename from samples/BookStore/src/Acme.BookStore.Domain/BookType.cs
rename to samples/BookStore/src/Acme.BookStore.Domain.Shared/BookType.cs
index 75d124d915..ba84b4fe2a 100644
--- a/samples/BookStore/src/Acme.BookStore.Domain/BookType.cs
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookType.cs
@@ -1,9 +1,9 @@
namespace Acme.BookStore
{
- public enum BookType : byte
+ public enum BookType
{
Undefined,
- Advanture,
+ Adventure,
Biography,
Dystopia,
Fantastic,
diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/cs.json b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/cs.json
new file mode 100644
index 0000000000..619521939c
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/cs.json
@@ -0,0 +1,8 @@
+{
+ "culture": "cs",
+ "texts": {
+ "Menu:Home": "Úvod",
+ "Welcome": "Vítejte",
+ "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io."
+ }
+}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/en.json b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/en.json
similarity index 56%
rename from samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/en.json
rename to samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/en.json
index 15dcae40ee..c5147cfc64 100644
--- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/en.json
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/en.json
@@ -6,15 +6,6 @@
"LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io.",
"Menu:BookStore": "Book Store",
"Menu:Books": "Books",
- "Name": "Name",
- "Type": "Type",
- "PublishDate": "Publish Date",
- "Price": "Price",
- "CreationTime": "Creation Time",
- "NewBook": "New book",
- "Books": "Books",
- "Update": "Update",
- "BookDeletionConfirmationMessage": "Are you sure to delete this book: {0}",
- "SuccessfullyDeleted": "Successfully deleted."
+ "BookDeletionConfirmationMessage": "Are you sure to delete the book {0}?"
}
}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/pt-BR.json b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/pt-BR.json
similarity index 100%
rename from samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/pt-BR.json
rename to samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/pt-BR.json
diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/tr.json b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/tr.json
new file mode 100644
index 0000000000..5bf83ee7a8
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/tr.json
@@ -0,0 +1,8 @@
+{
+ "culture": "tr",
+ "texts": {
+ "Menu:Home": "Ana sayfa",
+ "Welcome": "Hoşgeldiniz",
+ "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz."
+ }
+}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/zh-Hans.json b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/zh-Hans.json
new file mode 100644
index 0000000000..459fc0fefd
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/zh-Hans.json
@@ -0,0 +1,8 @@
+{
+ "culture": "zh-Hans",
+ "texts": {
+ "Menu:Home": "首页",
+ "Welcome": "欢迎",
+ "LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 cn.abp.io."
+ }
+ }
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/BookStoreResource.cs b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStoreResource.cs
similarity index 72%
rename from samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/BookStoreResource.cs
rename to samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStoreResource.cs
index 068968babf..cc4b935e58 100644
--- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/BookStoreResource.cs
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStoreResource.cs
@@ -1,6 +1,6 @@
using Volo.Abp.Localization;
-namespace Acme.BookStore.Localization.BookStore
+namespace Acme.BookStore.Localization
{
[LocalizationResourceName("BookStore")]
public class BookStoreResource
diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs b/samples/BookStore/src/Acme.BookStore.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs
new file mode 100644
index 0000000000..9ece5cc53e
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs
@@ -0,0 +1,11 @@
+namespace Acme.BookStore.MultiTenancy
+{
+ public static class MultiTenancyConsts
+ {
+ /* Enable/disable multi-tenancy easily in a single point.
+ * If you will never need to multi-tenancy, you can remove
+ * related modules and code parts, including this file.
+ */
+ public const bool IsEnabled = true;
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
index 4c0984d3b9..9efa77aa9a 100644
--- a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
+++ b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
@@ -1,25 +1,27 @@
-
+
-
+
netcoreapp2.2
Acme.BookStore
+
+
+
+
+
+
+
-
-
-
-
-
-
+
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Book.cs b/samples/BookStore/src/Acme.BookStore.Domain/Book.cs
index 12984a1896..93dd6d9adc 100644
--- a/samples/BookStore/src/Acme.BookStore.Domain/Book.cs
+++ b/samples/BookStore/src/Acme.BookStore.Domain/Book.cs
@@ -1,15 +1,10 @@
using System;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities.Auditing;
namespace Acme.BookStore
{
- [Table("Books")]
public class Book : AuditedAggregateRoot
{
- [Required]
- [StringLength(128)]
public string Name { get; set; }
public BookType Type { get; set; }
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreConsts.cs b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreConsts.cs
index 5c8cab1e72..96556e1b85 100644
--- a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreConsts.cs
+++ b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreConsts.cs
@@ -5,7 +5,5 @@
public const string DbTablePrefix = "App";
public const string DbSchema = null;
-
- public const bool IsMultiTenancyEnabled = true;
}
}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs
index 7575b109e2..950bd62d1b 100644
--- a/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs
+++ b/samples/BookStore/src/Acme.BookStore.Domain/BookStoreDomainModule.cs
@@ -1,48 +1,37 @@
-using Acme.BookStore.Localization.BookStore;
-using Volo.Abp.Auditing;
+using Acme.BookStore.MultiTenancy;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
-using Volo.Abp.Localization;
-using Volo.Abp.Localization.Resources.AbpValidation;
+using Volo.Abp.IdentityServer;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement.Identity;
+using Volo.Abp.PermissionManagement.IdentityServer;
+using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
-using Volo.Abp.VirtualFileSystem;
namespace Acme.BookStore
{
[DependsOn(
+ typeof(BookStoreDomainSharedModule),
+ typeof(AbpAuditLoggingDomainModule),
+ typeof(BackgroundJobsDomainModule),
+ typeof(AbpFeatureManagementDomainModule),
typeof(AbpIdentityDomainModule),
typeof(AbpPermissionManagementDomainIdentityModule),
- typeof(AbpAuditingModule),
- typeof(BackgroundJobsDomainModule),
- typeof(AbpAuditLoggingDomainModule),
- typeof(AbpTenantManagementDomainModule),
- typeof(AbpFeatureManagementDomainModule)
+ typeof(AbpIdentityServerDomainModule),
+ typeof(AbpPermissionManagementDomainIdentityServerModule),
+ typeof(AbpSettingManagementDomainModule),
+ typeof(AbpTenantManagementDomainModule)
)]
public class BookStoreDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
- Configure(options =>
- {
- options.FileSets.AddEmbedded("Acme.BookStore");
- });
-
- Configure(options =>
- {
- options.Resources
- .Add("en")
- .AddBaseTypes(typeof(AbpValidationResource))
- .AddVirtualJson("/Localization/BookStore");
- });
-
Configure(options =>
{
- options.IsEnabled = BookStoreConsts.IsMultiTenancyEnabled;
+ options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
}
}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Data/BookStoreDbMigrationService.cs b/samples/BookStore/src/Acme.BookStore.Domain/Data/BookStoreDbMigrationService.cs
new file mode 100644
index 0000000000..4db6b4af83
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain/Data/BookStoreDbMigrationService.cs
@@ -0,0 +1,39 @@
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
+using Volo.Abp.Data;
+using Volo.Abp.DependencyInjection;
+
+namespace Acme.BookStore.Data
+{
+ public class BookStoreDbMigrationService : ITransientDependency
+ {
+ public ILogger Logger { get; set; }
+
+ private readonly IDataSeeder _dataSeeder;
+ private readonly IBookStoreDbSchemaMigrator _dbSchemaMigrator;
+
+ public BookStoreDbMigrationService(
+ IDataSeeder dataSeeder,
+ IBookStoreDbSchemaMigrator dbSchemaMigrator)
+ {
+ _dataSeeder = dataSeeder;
+ _dbSchemaMigrator = dbSchemaMigrator;
+
+ Logger = NullLogger.Instance;
+ }
+
+ public async Task MigrateAsync()
+ {
+ Logger.LogInformation("Started database migrations...");
+
+ Logger.LogInformation("Migrating database schema...");
+ await _dbSchemaMigrator.MigrateAsync();
+
+ Logger.LogInformation("Executing database seed...");
+ await _dataSeeder.SeedAsync();
+
+ Logger.LogInformation("Successfully completed database migrations.");
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Data/IBookStoreDbSchemaMigrator.cs b/samples/BookStore/src/Acme.BookStore.Domain/Data/IBookStoreDbSchemaMigrator.cs
new file mode 100644
index 0000000000..5c94a6918e
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain/Data/IBookStoreDbSchemaMigrator.cs
@@ -0,0 +1,9 @@
+using System.Threading.Tasks;
+
+namespace Acme.BookStore.Data
+{
+ public interface IBookStoreDbSchemaMigrator
+ {
+ Task MigrateAsync();
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Data/NullBookStoreDbSchemaMigrator.cs b/samples/BookStore/src/Acme.BookStore.Domain/Data/NullBookStoreDbSchemaMigrator.cs
new file mode 100644
index 0000000000..f6ed8fc8de
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain/Data/NullBookStoreDbSchemaMigrator.cs
@@ -0,0 +1,16 @@
+using System.Threading.Tasks;
+using Volo.Abp.DependencyInjection;
+
+namespace Acme.BookStore.Data
+{
+ /* This is used if database provider does't define
+ * IBookStoreDbSchemaMigrator implementation.
+ */
+ public class NullBookStoreDbSchemaMigrator : IBookStoreDbSchemaMigrator, ITransientDependency
+ {
+ public Task MigrateAsync()
+ {
+ return Task.CompletedTask;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs b/samples/BookStore/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
new file mode 100644
index 0000000000..45c2420501
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Volo.Abp.Authorization.Permissions;
+using Volo.Abp.Configuration;
+using Volo.Abp.Data;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.Guids;
+using Volo.Abp.IdentityServer.ApiResources;
+using Volo.Abp.IdentityServer.Clients;
+using Volo.Abp.IdentityServer.IdentityResources;
+using Volo.Abp.PermissionManagement;
+using Volo.Abp.Uow;
+
+namespace Acme.BookStore.IdentityServer
+{
+ public class IdentityServerDataSeedContributor : IDataSeedContributor, ITransientDependency
+ {
+ private readonly IApiResourceRepository _apiResourceRepository;
+ private readonly IClientRepository _clientRepository;
+ private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
+ private readonly IGuidGenerator _guidGenerator;
+ private readonly IPermissionDataSeeder _permissionDataSeeder;
+ private readonly IConfigurationAccessor _configurationAccessor;
+
+ public IdentityServerDataSeedContributor(
+ IClientRepository clientRepository,
+ IApiResourceRepository apiResourceRepository,
+ IIdentityResourceDataSeeder identityResourceDataSeeder,
+ IGuidGenerator guidGenerator,
+ IPermissionDataSeeder permissionDataSeeder,
+ IConfigurationAccessor configurationAccessor)
+ {
+ _clientRepository = clientRepository;
+ _apiResourceRepository = apiResourceRepository;
+ _identityResourceDataSeeder = identityResourceDataSeeder;
+ _guidGenerator = guidGenerator;
+ _permissionDataSeeder = permissionDataSeeder;
+ _configurationAccessor = configurationAccessor;
+ }
+
+ [UnitOfWork]
+ public virtual async Task SeedAsync(DataSeedContext context)
+ {
+ await _identityResourceDataSeeder.CreateStandardResourcesAsync();
+ await CreateApiResourcesAsync();
+ await CreateClientsAsync();
+ }
+
+ private async Task CreateApiResourcesAsync()
+ {
+ var commonApiUserClaims = new[]
+ {
+ "email",
+ "email_verified",
+ "name",
+ "phone_number",
+ "phone_number_verified",
+ "role"
+ };
+
+ await CreateApiResourceAsync("BookStore", commonApiUserClaims);
+ }
+
+ private async Task CreateApiResourceAsync(string name, IEnumerable claims)
+ {
+ var apiResource = await _apiResourceRepository.FindByNameAsync(name);
+ if (apiResource == null)
+ {
+ apiResource = await _apiResourceRepository.InsertAsync(
+ new ApiResource(
+ _guidGenerator.Create(),
+ name,
+ name + " API"
+ ),
+ autoSave: true
+ );
+ }
+
+ foreach (var claim in claims)
+ {
+ if (apiResource.FindClaim(claim) == null)
+ {
+ apiResource.AddUserClaim(claim);
+ }
+ }
+
+ return await _apiResourceRepository.UpdateAsync(apiResource);
+ }
+
+ private async Task CreateClientsAsync()
+ {
+ const string commonSecret = "E5Xd4yMqjP5kjWFKrYgySBju6JVfCzMyFp7n2QmMrME=";
+
+ var commonScopes = new[]
+ {
+ "email",
+ "openid",
+ "profile",
+ "role",
+ "phone",
+ "address",
+ "BookStore"
+ };
+
+ var configurationSection = _configurationAccessor.Configuration.GetSection("IdentityServer:Clients");
+
+ //Web Client
+ var webClientId = configurationSection["BookStore_Web:ClientId"];
+ if (!webClientId.IsNullOrWhiteSpace())
+ {
+ var webClientRootUrl = configurationSection["BookStore_Web:RootUrl"].EnsureEndsWith('/');
+
+ /* BookStore_Web client is only needed if you created a tiered
+ * solution. Otherwise, you can delete this client. */
+
+ await CreateClientAsync(
+ webClientId,
+ commonScopes,
+ new[] { "hybrid" },
+ commonSecret,
+ redirectUri: $"{webClientRootUrl}signin-oidc",
+ postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc"
+ );
+ }
+
+ //Console Test Client
+ var consoleClientId = configurationSection["BookStore_ConsoleTestApp:ClientId"];
+ if (!consoleClientId.IsNullOrWhiteSpace())
+ {
+ await CreateClientAsync(
+ consoleClientId,
+ commonScopes,
+ new[] { "password", "client_credentials" },
+ commonSecret
+ );
+ }
+ }
+
+ private async Task CreateClientAsync(
+ string name,
+ IEnumerable scopes,
+ IEnumerable grantTypes,
+ string secret,
+ string redirectUri = null,
+ string postLogoutRedirectUri = null,
+ IEnumerable permissions = null)
+ {
+ var client = await _clientRepository.FindByCliendIdAsync(name);
+ if (client == null)
+ {
+ client = await _clientRepository.InsertAsync(
+ new Client(
+ _guidGenerator.Create(),
+ name
+ )
+ {
+ ClientName = name,
+ ProtocolType = "oidc",
+ Description = name,
+ AlwaysIncludeUserClaimsInIdToken = true,
+ AllowOfflineAccess = true,
+ AbsoluteRefreshTokenLifetime = 31536000, //365 days
+ AccessTokenLifetime = 31536000, //365 days
+ AuthorizationCodeLifetime = 300,
+ IdentityTokenLifetime = 300,
+ RequireConsent = false
+ },
+ autoSave: true
+ );
+ }
+
+ foreach (var scope in scopes)
+ {
+ if (client.FindScope(scope) == null)
+ {
+ client.AddScope(scope);
+ }
+ }
+
+ foreach (var grantType in grantTypes)
+ {
+ if (client.FindGrantType(grantType) == null)
+ {
+ client.AddGrantType(grantType);
+ }
+ }
+
+ if (client.FindSecret(secret) == null)
+ {
+ client.AddSecret(secret);
+ }
+
+ if (redirectUri != null)
+ {
+ if (client.FindRedirectUri(redirectUri) == null)
+ {
+ client.AddRedirectUri(redirectUri);
+ }
+ }
+
+ if (postLogoutRedirectUri != null)
+ {
+ if (client.FindPostLogoutRedirectUri(postLogoutRedirectUri) == null)
+ {
+ client.AddPostLogoutRedirectUri(postLogoutRedirectUri);
+ }
+ }
+
+ if (permissions != null)
+ {
+ await _permissionDataSeeder.SeedAsync(
+ ClientPermissionValueProvider.ProviderName,
+ name,
+ permissions
+ );
+ }
+
+ return await _clientRepository.UpdateAsync(client);
+ }
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json
deleted file mode 100644
index 86d19a6aa7..0000000000
--- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/cs.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "culture": "cs",
- "texts": {
- "Menu:Home": "Úvod",
- "Welcome": "Vítejte",
- "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io.",
- "Menu:BookStore": "Knihkupectví",
- "Menu:Books": "Knihy",
- "Name": "Název",
- "Type": "Typ",
- "PublishDate": "Publikováno",
- "Price": "Cena",
- "CreationTime": "Vytvořeno",
- "NewBook": "Nová kniha",
- "Books": "Knihy",
- "Update": "Aktualizovat",
- "BookDeletionConfirmationMessage": "Opravdu chcete smazat tuto knihu: {0}",
- "SuccessfullyDeleted": "Úspěšně smazáno."
- }
-}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/tr.json b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/tr.json
deleted file mode 100644
index fd17d64b8e..0000000000
--- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/tr.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "culture": "tr",
- "texts": {
- "Menu:Home": "Ana sayfa",
- "Welcome": "Hoşgeldiniz",
- "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz.",
- "Menu:BookStore": "Kitap Mağazası",
- "Menu:Books": "Kitaplar",
- "Name": "İsim",
- "Type": "Tür",
- "PublishDate": "Yayınlanma Tarihi",
- "Price": "Fiyat",
- "CreationTime": "Oluşturulma zamanı",
- "NewBook": "Yeni kitap",
- "Books": "Kitaplar",
- "Update": "Güncelle",
- "BookDeletionConfirmationMessage": "Bu kitabı silmek istediğinize emin misiniz: {0}",
- "SuccessfullyDeleted": "Başarıyla silindi."
- }
-}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/zh-Hans.json b/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/zh-Hans.json
deleted file mode 100644
index be57798695..0000000000
--- a/samples/BookStore/src/Acme.BookStore.Domain/Localization/BookStore/zh-Hans.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "culture": "zh-Hans",
- "texts": {
- "Menu:Home": "首页",
- "Welcome": "欢迎",
- "LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 cn.abp.io.",
- "Menu:BookStore": "图书商店",
- "Menu:Books": "图书",
- "Name": "名称",
- "Type": "类型",
- "PublishDate": "出版时间",
- "Price": "价格",
- "CreationTime": "添加时间",
- "NewBook": "新书籍",
- "Books": "图书",
- "Update": "更新",
- "BookDeletionConfirmationMessage": "你确定删除书箱: {0} 吗",
- "SuccessfullyDeleted": "删除成功."
- }
- }
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj
index d4c691c4e8..3b0318a10c 100644
--- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj
+++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj
@@ -1,4 +1,4 @@
-
+
@@ -7,11 +7,6 @@
Acme.BookStore
-
-
-
-
-
diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreEntityFrameworkCoreDbMigrationsModule.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreEntityFrameworkCoreDbMigrationsModule.cs
new file mode 100644
index 0000000000..88e21f2ce8
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreEntityFrameworkCoreDbMigrationsModule.cs
@@ -0,0 +1,16 @@
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.Modularity;
+
+namespace Acme.BookStore.EntityFrameworkCore
+{
+ [DependsOn(
+ typeof(BookStoreEntityFrameworkCoreModule)
+ )]
+ public class BookStoreEntityFrameworkCoreDbMigrationsModule : AbpModule
+ {
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ context.Services.AddAbpDbContext();
+ }
+ }
+}
diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContext.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContext.cs
index a43cc52fb6..541a91a0fd 100644
--- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContext.cs
+++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContext.cs
@@ -2,14 +2,21 @@
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 Acme.BookStore.EntityFrameworkCore
{
+ /* This DbContext is only used for database migrations.
+ * It is not used on runtime. See BookStoreDbContext for the runtime DbContext.
+ * It is a unified model that includes configuration for
+ * all used modules and your application.
+ */
public class BookStoreMigrationsDbContext : AbpDbContext
{
public BookStoreMigrationsDbContext(DbContextOptions options)
@@ -29,6 +36,8 @@ namespace Acme.BookStore.EntityFrameworkCore
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
+ builder.ConfigureIdentityServer();
+ builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement();
/* Configure customizations for entities from the modules included */
diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContextFactory.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContextFactory.cs
index bc1006d729..da72e6fb21 100644
--- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContextFactory.cs
+++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/BookStoreMigrationsDbContextFactory.cs
@@ -5,6 +5,8 @@ using Microsoft.Extensions.Configuration;
namespace Acme.BookStore.EntityFrameworkCore
{
+ /* This class is needed for EF Core console commands
+ * (like Add-Migration and Update-Database commands) */
public class BookStoreMigrationsDbContextFactory : IDesignTimeDbContextFactory
{
public BookStoreMigrationsDbContext CreateDbContext(string[] args)
diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EntityFrameworkCoreBookStoreDbSchemaMigrator.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EntityFrameworkCoreBookStoreDbSchemaMigrator.cs
new file mode 100644
index 0000000000..954c8f7a13
--- /dev/null
+++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EntityFrameworkCoreBookStoreDbSchemaMigrator.cs
@@ -0,0 +1,24 @@
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using Acme.BookStore.Data;
+using Volo.Abp.DependencyInjection;
+
+namespace Acme.BookStore.EntityFrameworkCore
+{
+ [Dependency(ReplaceServices = true)]
+ public class EntityFrameworkCoreBookStoreDbSchemaMigrator
+ : IBookStoreDbSchemaMigrator, ITransientDependency
+ {
+ private readonly BookStoreMigrationsDbContext _dbContext;
+
+ public EntityFrameworkCoreBookStoreDbSchemaMigrator(BookStoreMigrationsDbContext dbContext)
+ {
+ _dbContext = dbContext;
+ }
+
+ public async Task MigrateAsync()
+ {
+ await _dbContext.Database.MigrateAsync();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190416070050_Created_Book_Entity.Designer.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190603112909_Initial.Designer.cs
similarity index 55%
rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190416070050_Created_Book_Entity.Designer.cs
rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190603112909_Initial.Designer.cs
index 2ec683d7ed..53187bf54d 100644
--- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190416070050_Created_Book_Entity.Designer.cs
+++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190603112909_Initial.Designer.cs
@@ -10,50 +10,17 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Acme.BookStore.Migrations
{
[DbContext(typeof(BookStoreMigrationsDbContext))]
- [Migration("20190416070050_Created_Book_Entity")]
- partial class Created_Book_Entity
+ [Migration("20190603112909_Initial")]
+ partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
- .HasAnnotation("ProductVersion", "2.2.3-servicing-35854")
+ .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
- modelBuilder.Entity("Acme.BookStore.Book", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
-
- b.Property("ConcurrencyStamp");
-
- b.Property("CreationTime");
-
- b.Property("CreatorId");
-
- b.Property("ExtraProperties")
- .HasColumnName("ExtraProperties");
-
- b.Property("LastModificationTime");
-
- b.Property("LastModifierId");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128);
-
- b.Property("Price");
-
- b.Property("PublishDate");
-
- b.Property("Type");
-
- b.HasKey("Id");
-
- b.ToTable("AppBooks");
- });
-
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property("Id")
@@ -298,6 +265,32 @@ namespace Acme.BookStore.Migrations
b.ToTable("AbpBackgroundJobs");
});
+ modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128);
+
+ b.Property("ProviderKey")
+ .HasMaxLength(64);
+
+ b.Property("ProviderName")
+ .HasMaxLength(64);
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(128);
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name", "ProviderName", "ProviderKey");
+
+ b.ToTable("AbpFeatureValues");
+ });
+
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property("Id")
@@ -596,6 +589,482 @@ namespace Acme.BookStore.Migrations
b.ToTable("AbpUserTokens");
});
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .HasMaxLength(1000);
+
+ b.Property("DisplayName")
+ .HasMaxLength(200);
+
+ b.Property("Enabled");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200);
+
+ b.HasKey("Id");
+
+ b.ToTable("IdentityServerApiResources");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
+ {
+ b.Property("ApiResourceId");
+
+ b.Property("Type")
+ .HasMaxLength(196);
+
+ b.HasKey("ApiResourceId", "Type");
+
+ b.ToTable("IdentityServerApiClaims");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b =>
+ {
+ b.Property("ApiResourceId");
+
+ b.Property("Name")
+ .HasMaxLength(196);
+
+ b.Property("Description")
+ .HasMaxLength(256);
+
+ b.Property("DisplayName")
+ .HasMaxLength(128);
+
+ b.Property("Emphasize");
+
+ b.Property("Required");
+
+ b.Property("ShowInDiscoveryDocument");
+
+ b.HasKey("ApiResourceId", "Name");
+
+ b.ToTable("IdentityServerApiScopes");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b =>
+ {
+ b.Property("ApiResourceId");
+
+ b.Property("Name")
+ .HasMaxLength(196);
+
+ b.Property("Type")
+ .HasMaxLength(196);
+
+ b.HasKey("ApiResourceId", "Name", "Type");
+
+ b.ToTable("IdentityServerApiScopeClaims");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b =>
+ {
+ b.Property("ApiResourceId");
+
+ b.Property("Type")
+ .HasMaxLength(32);
+
+ b.Property("Value")
+ .HasMaxLength(196);
+
+ b.Property("Description")
+ .HasMaxLength(256);
+
+ b.Property("Expiration");
+
+ b.HasKey("ApiResourceId", "Type", "Value");
+
+ b.ToTable("IdentityServerApiSecrets");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("AbsoluteRefreshTokenLifetime");
+
+ b.Property("AccessTokenLifetime");
+
+ b.Property("AccessTokenType");
+
+ b.Property("AllowAccessTokensViaBrowser");
+
+ b.Property("AllowOfflineAccess");
+
+ b.Property("AllowPlainTextPkce");
+
+ b.Property("AllowRememberConsent");
+
+ b.Property("AlwaysIncludeUserClaimsInIdToken");
+
+ b.Property("AlwaysSendClientClaims");
+
+ b.Property("AuthorizationCodeLifetime");
+
+ b.Property("BackChannelLogoutSessionRequired");
+
+ b.Property("BackChannelLogoutUri")
+ .HasMaxLength(300);
+
+ b.Property("ClientClaimsPrefix")
+ .HasMaxLength(200);
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasMaxLength(200);
+
+ b.Property("ClientName")
+ .HasMaxLength(200);
+
+ b.Property("ClientUri")
+ .HasMaxLength(300);
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ConsentLifetime");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .HasMaxLength(1000);
+
+ b.Property("EnableLocalLogin");
+
+ b.Property("Enabled");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("FrontChannelLogoutSessionRequired");
+
+ b.Property("FrontChannelLogoutUri")
+ .HasMaxLength(300);
+
+ b.Property("IdentityTokenLifetime");
+
+ b.Property("IncludeJwtId");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId");
+
+ b.Property("LogoUri")
+ .HasMaxLength(300);
+
+ b.Property("PairWiseSubjectSalt")
+ .HasMaxLength(200);
+
+ b.Property("ProtocolType")
+ .IsRequired()
+ .HasMaxLength(200);
+
+ b.Property("RefreshTokenExpiration");
+
+ b.Property("RefreshTokenUsage");
+
+ b.Property("RequireClientSecret");
+
+ b.Property("RequireConsent");
+
+ b.Property("RequirePkce");
+
+ b.Property("SlidingRefreshTokenLifetime");
+
+ b.Property("UpdateAccessTokenClaimsOnRefresh");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId")
+ .IsUnique();
+
+ b.ToTable("IdentityServerClients");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("Type")
+ .HasMaxLength(250);
+
+ b.Property("Value")
+ .HasMaxLength(250);
+
+ b.HasKey("ClientId", "Type", "Value");
+
+ b.ToTable("IdentityServerClientClaims");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("Origin")
+ .HasMaxLength(150);
+
+ b.HasKey("ClientId", "Origin");
+
+ b.ToTable("IdentityServerClientCorsOrigins");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("GrantType")
+ .HasMaxLength(196);
+
+ b.HasKey("ClientId", "GrantType");
+
+ b.ToTable("IdentityServerClientGrantTypes");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("Provider")
+ .HasMaxLength(64);
+
+ b.HasKey("ClientId", "Provider");
+
+ b.ToTable("IdentityServerClientIdPRestrictions");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("PostLogoutRedirectUri")
+ .HasMaxLength(200);
+
+ b.HasKey("ClientId", "PostLogoutRedirectUri");
+
+ b.ToTable("IdentityServerClientPostLogoutRedirectUris");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("Key")
+ .HasMaxLength(64);
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(128);
+
+ b.HasKey("ClientId", "Key");
+
+ b.ToTable("IdentityServerClientProperties");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("RedirectUri")
+ .HasMaxLength(200);
+
+ b.HasKey("ClientId", "RedirectUri");
+
+ b.ToTable("IdentityServerClientRedirectUris");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("Scope")
+ .HasMaxLength(196);
+
+ b.HasKey("ClientId", "Scope");
+
+ b.ToTable("IdentityServerClientScopes");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b =>
+ {
+ b.Property("ClientId");
+
+ b.Property("Type")
+ .HasMaxLength(32);
+
+ b.Property("Value")
+ .HasMaxLength(196);
+
+ b.Property("Description")
+ .HasMaxLength(256);
+
+ b.Property("Expiration");
+
+ b.HasKey("ClientId", "Type", "Value");
+
+ b.ToTable("IdentityServerClientSecrets");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b =>
+ {
+ b.Property("Key")
+ .HasMaxLength(200);
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasMaxLength(200);
+
+ b.Property("ConcurrencyStamp");
+
+ b.Property("CreationTime");
+
+ b.Property("Data")
+ .IsRequired();
+
+ b.Property("Expiration");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("Id");
+
+ b.Property("SubjectId")
+ .HasMaxLength(200);
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(50);
+
+ b.HasKey("Key");
+
+ b.HasIndex("SubjectId", "ClientId", "Type");
+
+ b.ToTable("IdentityServerPersistedGrants");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b =>
+ {
+ b.Property("IdentityResourceId");
+
+ b.Property("Type")
+ .HasMaxLength(196);
+
+ b.HasKey("IdentityResourceId", "Type");
+
+ b.ToTable("IdentityServerIdentityClaims");
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .HasMaxLength(1000);
+
+ b.Property("DisplayName")
+ .HasMaxLength(200);
+
+ b.Property("Emphasize");
+
+ b.Property("Enabled");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200);
+
+ b.Property("Required");
+
+ b.Property("ShowInDiscoveryDocument");
+
+ b.HasKey("Id");
+
+ b.ToTable("IdentityServerIdentityResources");
+ });
+
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property("Id")
@@ -780,6 +1249,118 @@ namespace Acme.BookStore.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource")
+ .WithMany("UserClaims")
+ .HasForeignKey("ApiResourceId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource")
+ .WithMany("Scopes")
+ .HasForeignKey("ApiResourceId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope")
+ .WithMany("UserClaims")
+ .HasForeignKey("ApiResourceId", "Name")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource")
+ .WithMany("Secrets")
+ .HasForeignKey("ApiResourceId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("Claims")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("AllowedCorsOrigins")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("AllowedGrantTypes")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("IdentityProviderRestrictions")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("PostLogoutRedirectUris")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("Properties")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("RedirectUris")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("AllowedScopes")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.Clients.Client")
+ .WithMany("ClientSecrets")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b =>
+ {
+ b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource")
+ .WithMany("UserClaims")
+ .HasForeignKey("IdentityResourceId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant")
diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190402131334_Initial.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190603112909_Initial.cs
similarity index 51%
rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190402131334_Initial.cs
rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190603112909_Initial.cs
index fb85c4cc6d..45cd778b73 100644
--- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190402131334_Initial.cs
+++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20190603112909_Initial.cs
@@ -80,6 +80,21 @@ namespace Acme.BookStore.Migrations
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "AbpFeatureValues",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ Name = table.Column(maxLength: 128, nullable: false),
+ Value = table.Column(maxLength: 128, nullable: false),
+ ProviderName = table.Column(maxLength: 64, nullable: true),
+ ProviderKey = table.Column(maxLength: 64, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
@@ -186,6 +201,131 @@ namespace Acme.BookStore.Migrations
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "IdentityServerApiResources",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ ExtraProperties = table.Column(nullable: true),
+ ConcurrencyStamp = table.Column(nullable: true),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ LastModificationTime = table.Column(nullable: true),
+ LastModifierId = table.Column(nullable: true),
+ IsDeleted = table.Column(nullable: false, defaultValue: false),
+ DeleterId = table.Column(nullable: true),
+ DeletionTime = table.Column(nullable: true),
+ Name = table.Column(maxLength: 200, nullable: false),
+ DisplayName = table.Column(maxLength: 200, nullable: true),
+ Description = table.Column(maxLength: 1000, nullable: true),
+ Enabled = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "IdentityServerClients",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ ExtraProperties = table.Column(nullable: true),
+ ConcurrencyStamp = table.Column(nullable: true),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ LastModificationTime = table.Column(nullable: true),
+ LastModifierId = table.Column(nullable: true),
+ IsDeleted = table.Column(nullable: false, defaultValue: false),
+ DeleterId = table.Column(nullable: true),
+ DeletionTime = table.Column(nullable: true),
+ ClientId = table.Column(maxLength: 200, nullable: false),
+ ClientName = table.Column(maxLength: 200, nullable: true),
+ Description = table.Column(maxLength: 1000, nullable: true),
+ ClientUri = table.Column(maxLength: 300, nullable: true),
+ LogoUri = table.Column(maxLength: 300, nullable: true),
+ Enabled = table.Column(nullable: false),
+ ProtocolType = table.Column(maxLength: 200, nullable: false),
+ RequireClientSecret = table.Column(nullable: false),
+ RequireConsent = table.Column(nullable: false),
+ AllowRememberConsent = table.Column(nullable: false),
+ AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false),
+ RequirePkce = table.Column(nullable: false),
+ AllowPlainTextPkce = table.Column(nullable: false),
+ AllowAccessTokensViaBrowser = table.Column(nullable: false),
+ FrontChannelLogoutUri = table.Column(maxLength: 300, nullable: true),
+ FrontChannelLogoutSessionRequired = table.Column(nullable: false),
+ BackChannelLogoutUri = table.Column(maxLength: 300, nullable: true),
+ BackChannelLogoutSessionRequired = table.Column(nullable: false),
+ AllowOfflineAccess = table.Column(nullable: false),
+ IdentityTokenLifetime = table.Column(nullable: false),
+ AccessTokenLifetime = table.Column(nullable: false),
+ AuthorizationCodeLifetime = table.Column(nullable: false),
+ ConsentLifetime = table.Column(nullable: true),
+ AbsoluteRefreshTokenLifetime = table.Column(nullable: false),
+ SlidingRefreshTokenLifetime = table.Column(nullable: false),
+ RefreshTokenUsage = table.Column(nullable: false),
+ UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false),
+ RefreshTokenExpiration = table.Column(nullable: false),
+ AccessTokenType = table.Column(nullable: false),
+ EnableLocalLogin = table.Column(nullable: false),
+ IncludeJwtId = table.Column(nullable: false),
+ AlwaysSendClientClaims = table.Column(nullable: false),
+ ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true),
+ PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "IdentityServerIdentityResources",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ ExtraProperties = table.Column(nullable: true),
+ ConcurrencyStamp = table.Column(nullable: true),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ LastModificationTime = table.Column(nullable: true),
+ LastModifierId = table.Column(nullable: true),
+ IsDeleted = table.Column(nullable: false, defaultValue: false),
+ DeleterId = table.Column(nullable: true),
+ DeletionTime = table.Column