diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppDbContext.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppDbContext.cs
index c73422be7e..16e610dc81 100644
--- a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppDbContext.cs
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppDbContext.cs
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
+using Volo.Abp.BlobStoring.Database.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
@@ -23,6 +24,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureBlogging();
+ modelBuilder.ConfigureBlobStoring();
}
}
}
diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs
index fd8ff13b2a..bdc6a380e7 100644
--- a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.BlobStoring.Database.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Modularity;
@@ -13,9 +14,9 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
- typeof(AbpEntityFrameworkCoreSqlServerModule))]
+ typeof(AbpEntityFrameworkCoreSqlServerModule),
+ typeof(BlobStoringDatabaseEntityFrameworkCoreModule))]
public class BloggingTestAppEntityFrameworkCoreModule : AbpModule
{
-
}
}
diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200922115311_Added_BlobStoing.Designer.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200922115311_Added_BlobStoing.Designer.cs
new file mode 100644
index 0000000000..5ef64bb0c8
--- /dev/null
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200922115311_Added_BlobStoing.Designer.cs
@@ -0,0 +1,1260 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+using Volo.BloggingTestApp.EntityFrameworkCore;
+
+namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
+{
+ [DbContext(typeof(BloggingTestAppDbContext))]
+ [Migration("20200922115311_Added_BlobStoing")]
+ partial class Added_BlobStoing
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
+ .HasAnnotation("ProductVersion", "3.1.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("ContainerId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Content")
+ .HasColumnType("varbinary(max)")
+ .HasMaxLength(2147483647);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.HasIndex("TenantId", "ContainerId", "Name");
+
+ b.ToTable("AbpBlobs");
+ });
+
+ modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "Name");
+
+ b.ToTable("AbpBlobContainers");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsStatic")
+ .HasColumnType("bit");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("Regex")
+ .HasColumnType("nvarchar(512)")
+ .HasMaxLength(512);
+
+ b.Property("RegexDescription")
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("Required")
+ .HasColumnType("bit");
+
+ b.Property("ValueType")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("AbpClaimTypes");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDefault")
+ .HasColumnName("IsDefault")
+ .HasColumnType("bit");
+
+ b.Property("IsPublic")
+ .HasColumnName("IsPublic")
+ .HasColumnType("bit");
+
+ b.Property("IsStatic")
+ .HasColumnName("IsStatic")
+ .HasColumnType("bit");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName");
+
+ b.ToTable("AbpRoles");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClaimType")
+ .IsRequired()
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("ClaimValue")
+ .HasColumnType("nvarchar(1024)")
+ .HasMaxLength(1024);
+
+ b.Property("RoleId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AbpRoleClaims");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Action")
+ .HasColumnType("nvarchar(96)")
+ .HasMaxLength(96);
+
+ b.Property("ApplicationName")
+ .HasColumnType("nvarchar(96)")
+ .HasMaxLength(96);
+
+ b.Property("BrowserInfo")
+ .HasColumnType("nvarchar(512)")
+ .HasMaxLength(512);
+
+ b.Property("ClientId")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("ClientIpAddress")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("CorrelationId")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Identity")
+ .HasColumnType("nvarchar(96)")
+ .HasMaxLength(96);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantName")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UserName")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "Action");
+
+ b.HasIndex("TenantId", "ApplicationName");
+
+ b.HasIndex("TenantId", "Identity");
+
+ b.HasIndex("TenantId", "UserId");
+
+ b.ToTable("AbpSecurityLogs");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AccessFailedCount")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("AccessFailedCount")
+ .HasColumnType("int")
+ .HasDefaultValue(0);
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnName("Email")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("EmailConfirmed")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("EmailConfirmed")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("IsExternal")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsExternal")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LockoutEnabled")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("LockoutEnabled")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("LockoutEnd")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("Name")
+ .HasColumnName("Name")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("NormalizedEmail")
+ .IsRequired()
+ .HasColumnName("NormalizedEmail")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("NormalizedUserName")
+ .IsRequired()
+ .HasColumnName("NormalizedUserName")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("PasswordHash")
+ .HasColumnName("PasswordHash")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("PhoneNumber")
+ .HasColumnName("PhoneNumber")
+ .HasColumnType("nvarchar(16)")
+ .HasMaxLength(16);
+
+ b.Property("PhoneNumberConfirmed")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("PhoneNumberConfirmed")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("SecurityStamp")
+ .IsRequired()
+ .HasColumnName("SecurityStamp")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("Surname")
+ .HasColumnName("Surname")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TwoFactorEnabled")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("TwoFactorEnabled")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnName("UserName")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.HasKey("Id");
+
+ b.HasIndex("Email");
+
+ b.HasIndex("NormalizedEmail");
+
+ b.HasIndex("NormalizedUserName");
+
+ b.HasIndex("UserName");
+
+ b.ToTable("AbpUsers");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClaimType")
+ .IsRequired()
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("ClaimValue")
+ .HasColumnType("nvarchar(1024)")
+ .HasMaxLength(1024);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AbpUserClaims");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LoginProvider")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("ProviderKey")
+ .IsRequired()
+ .HasColumnType("nvarchar(196)")
+ .HasMaxLength(196);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("UserId", "LoginProvider");
+
+ b.HasIndex("LoginProvider", "ProviderKey");
+
+ b.ToTable("AbpUserLogins");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b =>
+ {
+ b.Property("OrganizationUnitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("OrganizationUnitId", "UserId");
+
+ b.HasIndex("UserId", "OrganizationUnitId");
+
+ b.ToTable("AbpUserOrganizationUnits");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RoleId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId", "UserId");
+
+ b.ToTable("AbpUserRoles");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LoginProvider")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("Name")
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Value")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AbpUserTokens");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasColumnName("Code")
+ .HasColumnType("nvarchar(95)")
+ .HasMaxLength(95);
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasColumnName("DisplayName")
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Code");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("AbpOrganizationUnits");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b =>
+ {
+ b.Property("OrganizationUnitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RoleId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("OrganizationUnitId", "RoleId");
+
+ b.HasIndex("RoleId", "OrganizationUnitId");
+
+ b.ToTable("AbpOrganizationUnitRoles");
+ });
+
+ modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("ProviderKey")
+ .IsRequired()
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("ProviderName")
+ .IsRequired()
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name", "ProviderName", "ProviderKey");
+
+ b.ToTable("AbpPermissionGrants");
+ });
+
+ modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("ProviderKey")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("ProviderName")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("Value")
+ .IsRequired()
+ .HasColumnType("nvarchar(2048)")
+ .HasMaxLength(2048);
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name", "ProviderName", "ProviderKey");
+
+ b.ToTable("AbpSettings");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .HasColumnName("Description")
+ .HasColumnType("nvarchar(1024)")
+ .HasMaxLength(1024);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnName("Name")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("ShortName")
+ .IsRequired()
+ .HasColumnName("ShortName")
+ .HasColumnType("nvarchar(32)")
+ .HasMaxLength(32);
+
+ b.HasKey("Id");
+
+ b.ToTable("BlgBlogs");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PostId")
+ .HasColumnName("PostId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RepliedCommentId")
+ .HasColumnName("RepliedCommentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasColumnName("Text")
+ .HasColumnType("nvarchar(1024)")
+ .HasMaxLength(1024);
+
+ b.HasKey("Id");
+
+ b.HasIndex("PostId");
+
+ b.HasIndex("RepliedCommentId");
+
+ b.ToTable("BlgComments");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BlogId")
+ .HasColumnName("BlogId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("Content")
+ .HasColumnName("Content")
+ .HasColumnType("nvarchar(max)")
+ .HasMaxLength(1048576);
+
+ b.Property("CoverImage")
+ .IsRequired()
+ .HasColumnName("CoverImage")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .HasColumnName("Description")
+ .HasColumnType("nvarchar(1000)")
+ .HasMaxLength(1000);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ReadCount")
+ .HasColumnType("int");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnName("Title")
+ .HasColumnType("nvarchar(512)")
+ .HasMaxLength(512);
+
+ b.Property("Url")
+ .IsRequired()
+ .HasColumnName("Url")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.HasKey("Id");
+
+ b.HasIndex("BlogId");
+
+ b.ToTable("BlgPosts");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
+ {
+ b.Property("PostId")
+ .HasColumnName("PostId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TagId")
+ .HasColumnName("TagId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("PostId", "TagId");
+
+ b.HasIndex("TagId");
+
+ b.ToTable("BlgPostTags");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BlogId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .HasColumnName("Description")
+ .HasColumnType("nvarchar(512)")
+ .HasMaxLength(512);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnName("Name")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("UsageCount")
+ .HasColumnName("UsageCount")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("BlgTags");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnName("Email")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("EmailConfirmed")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("EmailConfirmed")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .HasColumnName("Name")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("PhoneNumber")
+ .HasColumnName("PhoneNumber")
+ .HasColumnType("nvarchar(16)")
+ .HasMaxLength(16);
+
+ b.Property("PhoneNumberConfirmed")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("PhoneNumberConfirmed")
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("Surname")
+ .HasColumnName("Surname")
+ .HasColumnType("nvarchar(64)")
+ .HasMaxLength(64);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnName("UserName")
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.HasKey("Id");
+
+ b.ToTable("BlgUsers");
+ });
+
+ modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
+ {
+ b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null)
+ .WithMany()
+ .HasForeignKey("ContainerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.IdentityRole", null)
+ .WithMany("Claims")
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.IdentityUser", null)
+ .WithMany("Claims")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.IdentityUser", null)
+ .WithMany("Logins")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.OrganizationUnit", null)
+ .WithMany()
+ .HasForeignKey("OrganizationUnitId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Volo.Abp.Identity.IdentityUser", null)
+ .WithMany("OrganizationUnits")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Volo.Abp.Identity.IdentityUser", null)
+ .WithMany("Roles")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.IdentityUser", null)
+ .WithMany("Tokens")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.OrganizationUnit", null)
+ .WithMany()
+ .HasForeignKey("ParentId");
+ });
+
+ modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b =>
+ {
+ b.HasOne("Volo.Abp.Identity.OrganizationUnit", null)
+ .WithMany("Roles")
+ .HasForeignKey("OrganizationUnitId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Volo.Abp.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
+ {
+ b.HasOne("Volo.Blogging.Posts.Post", null)
+ .WithMany()
+ .HasForeignKey("PostId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Volo.Blogging.Comments.Comment", null)
+ .WithMany()
+ .HasForeignKey("RepliedCommentId");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
+ {
+ b.HasOne("Volo.Blogging.Blogs.Blog", null)
+ .WithMany()
+ .HasForeignKey("BlogId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
+ {
+ b.HasOne("Volo.Blogging.Posts.Post", null)
+ .WithMany("Tags")
+ .HasForeignKey("PostId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Volo.Blogging.Tagging.Tag", null)
+ .WithMany()
+ .HasForeignKey("TagId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200922115311_Added_BlobStoing.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200922115311_Added_BlobStoing.cs
new file mode 100644
index 0000000000..9ad5b7fcc2
--- /dev/null
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200922115311_Added_BlobStoing.cs
@@ -0,0 +1,73 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
+{
+ public partial class Added_BlobStoing : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "AbpBlobContainers",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ ExtraProperties = table.Column(nullable: true),
+ ConcurrencyStamp = table.Column(maxLength: 40, nullable: true),
+ TenantId = table.Column(nullable: true),
+ Name = table.Column(maxLength: 128, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpBlobContainers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AbpBlobs",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ ExtraProperties = table.Column(nullable: true),
+ ConcurrencyStamp = table.Column(maxLength: 40, nullable: true),
+ ContainerId = table.Column(nullable: false),
+ TenantId = table.Column(nullable: true),
+ Name = table.Column(maxLength: 256, nullable: false),
+ Content = table.Column(maxLength: 2147483647, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpBlobs", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AbpBlobs_AbpBlobContainers_ContainerId",
+ column: x => x.ContainerId,
+ principalTable: "AbpBlobContainers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpBlobContainers_TenantId_Name",
+ table: "AbpBlobContainers",
+ columns: new[] { "TenantId", "Name" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpBlobs_ContainerId",
+ table: "AbpBlobs",
+ column: "ContainerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpBlobs_TenantId_ContainerId_Name",
+ table: "AbpBlobs",
+ columns: new[] { "TenantId", "ContainerId", "Name" });
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "AbpBlobs");
+
+ migrationBuilder.DropTable(
+ name: "AbpBlobContainers");
+ }
+ }
+}
diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
index 47647bb25e..a52f7e6b95 100644
--- a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
@@ -21,6 +21,79 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+ modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("ContainerId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Content")
+ .HasColumnType("varbinary(max)")
+ .HasMaxLength(2147483647);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(256)")
+ .HasMaxLength(256);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.HasIndex("TenantId", "ContainerId", "Name");
+
+ b.ToTable("AbpBlobs");
+ });
+
+ modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnName("ConcurrencyStamp")
+ .HasColumnType("nvarchar(40)")
+ .HasMaxLength(40);
+
+ b.Property("ExtraProperties")
+ .HasColumnName("ExtraProperties")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(128)")
+ .HasMaxLength(128);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "Name");
+
+ b.ToTable("AbpBlobContainers");
+ });
+
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property("Id")
@@ -1046,6 +1119,15 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.ToTable("BlgUsers");
});
+ modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
+ {
+ b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null)
+ .WithMany()
+ .HasForeignKey("ContainerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Volo.BloggingTestApp.EntityFrameworkCore.csproj b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Volo.BloggingTestApp.EntityFrameworkCore.csproj
index 5d3175a12a..b6705f41c8 100644
--- a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Volo.BloggingTestApp.EntityFrameworkCore.csproj
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Volo.BloggingTestApp.EntityFrameworkCore.csproj
@@ -12,6 +12,7 @@
+
diff --git a/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj b/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj
index cf886e234f..a846bb0ca6 100644
--- a/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj
+++ b/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj
@@ -12,6 +12,7 @@
+
diff --git a/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo/BloggingTestApp/MongoDB/BloggingTestAppMongoDbModule.cs b/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo/BloggingTestApp/MongoDB/BloggingTestAppMongoDbModule.cs
index b86d5fdec5..621fbbbafd 100644
--- a/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo/BloggingTestApp/MongoDB/BloggingTestAppMongoDbModule.cs
+++ b/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo/BloggingTestApp/MongoDB/BloggingTestAppMongoDbModule.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
+using Volo.Abp.BlobStoring.Database.MongoDB;
using Volo.Abp.Identity.MongoDB;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.MongoDB;
@@ -13,7 +11,8 @@ namespace Volo.BloggingTestApp.MongoDB
typeof(AbpIdentityMongoDbModule),
typeof(BloggingMongoDbModule),
typeof(AbpSettingManagementMongoDbModule),
- typeof(AbpPermissionManagementMongoDbModule)
+ typeof(AbpPermissionManagementMongoDbModule),
+ typeof(BlobStoringDatabaseMongoDbModule)
)]
public class BloggingTestAppMongoDbModule : AbpModule
{
diff --git a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
index 0cbdeaf6fc..600cc05f84 100644
--- a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
+++ b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
@@ -23,6 +23,8 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Mvc.UI.Theming;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Autofac;
+using Volo.Abp.BlobStoring;
+using Volo.Abp.BlobStoring.Database;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity;
@@ -37,7 +39,6 @@ using Volo.Blogging;
using Volo.Blogging.Admin;
using Volo.Blogging.Files;
using Volo.BloggingTestApp.EntityFrameworkCore;
-using Volo.BloggingTestApp.MongoDB;
namespace Volo.BloggingTestApp
{
@@ -57,6 +58,7 @@ namespace Volo.BloggingTestApp
typeof(AbpIdentityApplicationModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementApplicationModule),
+ typeof(BlobStoringDatabaseDomainModule),
typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule)
)]
@@ -130,9 +132,12 @@ namespace Volo.BloggingTestApp
options.DefaultThemeName = BasicTheme.Name;
});
- Configure(options =>
+ Configure(options =>
{
- options.FileUploadLocalFolder = Path.Combine(hostingEnvironment.WebRootPath, "files");
+ options.Containers.ConfigureDefault(container =>
+ {
+ container.UseDatabase();
+ });
});
}
diff --git a/modules/blogging/app/Volo.BloggingTestApp/Properties/launchSettings.json b/modules/blogging/app/Volo.BloggingTestApp/Properties/launchSettings.json
index a6901d0c07..50c5ad8eff 100644
--- a/modules/blogging/app/Volo.BloggingTestApp/Properties/launchSettings.json
+++ b/modules/blogging/app/Volo.BloggingTestApp/Properties/launchSettings.json
@@ -3,7 +3,7 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
- "applicationUrl": "http://localhost:50013/",
+ "applicationUrl": "https://localhost:40013/",
"sslPort": 0
}
},
@@ -21,7 +21,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
- "applicationUrl": "http://localhost:50017/"
+ "applicationUrl": "https://localhost:40017/"
}
}
-}
\ No newline at end of file
+}
diff --git a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
index 5d56d83ec9..dc8670d4b7 100644
--- a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
+++ b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
@@ -34,7 +34,7 @@
-
+
diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj
index 9c4070fe25..8c9f39e023 100644
--- a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj
+++ b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj
@@ -16,6 +16,7 @@
+
diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs
index 31d24090a1..e33ab7f282 100644
--- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs
+++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
+using Volo.Abp.BlobStoring;
using Volo.Abp.Caching;
using Volo.Abp.Modularity;
using Volo.Blogging.Comments;
@@ -12,7 +13,8 @@ namespace Volo.Blogging
typeof(BloggingDomainModule),
typeof(BloggingApplicationContractsModule),
typeof(AbpCachingModule),
- typeof(AbpAutoMapperModule))]
+ typeof(AbpAutoMapperModule),
+ typeof(AbpBlobStoringModule))]
public class BloggingApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingFileContainer.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingFileContainer.cs
new file mode 100644
index 0000000000..e2bfdb95c7
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingFileContainer.cs
@@ -0,0 +1,10 @@
+using Volo.Abp.BlobStoring;
+
+namespace Volo.Blogging
+{
+ [BlobContainerName("blogging-files")]
+ public class BloggingFileContainer
+ {
+
+ }
+}
diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/BlogFileOptions.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/BlogFileOptions.cs
index 7243595802..3096341fa2 100644
--- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/BlogFileOptions.cs
+++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/BlogFileOptions.cs
@@ -1,4 +1,6 @@
-namespace Volo.Blogging.Files
+using System;
+
+namespace Volo.Blogging.Files
{
/* TODO:
* - It is not to have different options for all different modules. We should find a more generic way.
@@ -6,6 +8,7 @@
*/
public class BlogFileOptions
{
+ [Obsolete("Now store using blob storing system, will be deleted in a next version")]
public string FileUploadLocalFolder { get; set; }
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/FileAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/FileAppService.cs
index cdfd4cb836..8fdd12858d 100644
--- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/FileAppService.cs
+++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/FileAppService.cs
@@ -2,9 +2,9 @@
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Threading.Tasks;
-using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Volo.Abp;
+using Volo.Abp.BlobStoring;
using Volo.Abp.Validation;
using Volo.Blogging.Areas.Blog.Helpers;
@@ -12,42 +12,25 @@ namespace Volo.Blogging.Files
{
public class FileAppService : BloggingAppServiceBase, IFileAppService
{
- public BlogFileOptions Options { get; }
- private readonly ILogger _logger;
+ protected IBlobContainer BlobContainer { get; }
- public FileAppService(IOptions options, ILogger logger)
+ public FileAppService(
+ IBlobContainer blobContainer)
{
- _logger = logger;
- Options = options.Value;
+ BlobContainer = blobContainer;
}
- public virtual Task GetAsync(string name)
+ public virtual async Task GetAsync(string name)
{
Check.NotNullOrWhiteSpace(name, nameof(name));
- if (!Directory.Exists(Options.FileUploadLocalFolder))
+ return new RawFileDto
{
- Directory.CreateDirectory(Options.FileUploadLocalFolder);
- return Task.FromResult(
- new RawFileDto
- {
- Bytes = new byte[0]
- }
- );
- }
-
- var filePath = Path.Combine(Options.FileUploadLocalFolder, name);
-
- if (File.Exists(filePath))
- {
- return Task.FromResult(new RawFileDto {Bytes = File.ReadAllBytes(filePath)});
- }
-
- _logger.LogError($"Cannot find the file {filePath}");
- return Task.FromResult(RawFileDto.EmptyResult());
+ Bytes = await BlobContainer.GetAllBytesAsync(name)
+ };
}
- public virtual Task CreateAsync(FileUploadInputDto input)
+ public virtual async Task CreateAsync(FileUploadInputDto input)
{
if (input.Bytes.IsNullOrEmpty())
{
@@ -65,20 +48,14 @@ namespace Volo.Blogging.Files
}
var uniqueFileName = GenerateUniqueFileName(Path.GetExtension(input.Name));
- var filePath = Path.Combine(Options.FileUploadLocalFolder, uniqueFileName);
- if (!Directory.Exists(Options.FileUploadLocalFolder))
- {
- Directory.CreateDirectory(Options.FileUploadLocalFolder);
- }
-
- File.WriteAllBytes(filePath, input.Bytes); //TODO: Previously was using WriteAllBytesAsync, but it's only in .netcore.
+ await BlobContainer.SaveAsync(uniqueFileName, input.Bytes);
- return Task.FromResult(new FileUploadOutputDto
+ return new FileUploadOutputDto
{
Name = uniqueFileName,
WebUrl = "/api/blogging/files/www/" + uniqueFileName
- });
+ };
}
private static void ThrowValidationException(string message, string memberName)