mirror of https://github.com/abpframework/abp.git
54 changed files with 836 additions and 893 deletions
@ -1,9 +1,8 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp.EfCore |
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp.EfCore; |
|||
|
|||
public interface IBlobStoringHostDbSchemaMigrator |
|||
{ |
|||
public interface IBlobStoringHostDbSchemaMigrator |
|||
{ |
|||
Task MigrateAsync(); |
|||
} |
|||
} |
|||
Task MigrateAsync(); |
|||
} |
|||
|
|||
@ -1,9 +1,8 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp |
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp; |
|||
|
|||
public interface IBlobService |
|||
{ |
|||
public interface IBlobService |
|||
{ |
|||
Task SaveFile(string fileName = "File Name", string fileContent = "File Content"); |
|||
} |
|||
} |
|||
Task SaveFile(string fileName = "File Name", string fileContent = "File Content"); |
|||
} |
|||
|
|||
@ -1,73 +1,70 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp.Migrations |
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp.Migrations; |
|||
|
|||
public partial class Initial : Migration |
|||
{ |
|||
public partial class Initial : Migration |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "AbpBlobContainers", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(nullable: false), |
|||
ExtraProperties = table.Column<string>(nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true), |
|||
TenantId = table.Column<Guid>(nullable: true), |
|||
Name = table.Column<string>(maxLength: 128, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpBlobContainers", x => x.Id); |
|||
}); |
|||
migrationBuilder.CreateTable( |
|||
name: "AbpBlobContainers", |
|||
columns: table => new { |
|||
Id = table.Column<Guid>(nullable: false), |
|||
ExtraProperties = table.Column<string>(nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true), |
|||
TenantId = table.Column<Guid>(nullable: true), |
|||
Name = table.Column<string>(maxLength: 128, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpBlobContainers", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpBlobs", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(nullable: false), |
|||
ExtraProperties = table.Column<string>(nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true), |
|||
ContainerId = table.Column<Guid>(nullable: false), |
|||
TenantId = table.Column<Guid>(nullable: true), |
|||
Name = table.Column<string>(maxLength: 256, nullable: false), |
|||
Content = table.Column<byte[]>(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.CreateTable( |
|||
name: "AbpBlobs", |
|||
columns: table => new { |
|||
Id = table.Column<Guid>(nullable: false), |
|||
ExtraProperties = table.Column<string>(nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true), |
|||
ContainerId = table.Column<Guid>(nullable: false), |
|||
TenantId = table.Column<Guid>(nullable: true), |
|||
Name = table.Column<string>(maxLength: 256, nullable: false), |
|||
Content = table.Column<byte[]>(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_AbpBlobContainers_TenantId_Name", |
|||
table: "AbpBlobContainers", |
|||
columns: new[] { "TenantId", "Name" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpBlobs_ContainerId", |
|||
table: "AbpBlobs", |
|||
column: "ContainerId"); |
|||
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" }); |
|||
} |
|||
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"); |
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpBlobs"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpBlobContainers"); |
|||
} |
|||
migrationBuilder.DropTable( |
|||
name: "AbpBlobContainers"); |
|||
} |
|||
} |
|||
|
|||
@ -1,7 +1,6 @@ |
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp |
|||
namespace BlobStoring.Database.Host.ConsoleApp.ConsoleApp; |
|||
|
|||
public class ProfilePictureContainer |
|||
{ |
|||
public class ProfilePictureContainer |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
@ -1,7 +1,6 @@ |
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
public static class BlobStoringDatabaseErrorCodes |
|||
{ |
|||
public static class BlobStoringDatabaseErrorCodes |
|||
{ |
|||
//Add your business exception error codes here...
|
|||
} |
|||
//Add your business exception error codes here...
|
|||
} |
|||
|
|||
@ -1,15 +1,14 @@ |
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
public static class DatabaseBlobConsts |
|||
{ |
|||
public static class DatabaseBlobConsts |
|||
{ |
|||
/// <summary>
|
|||
/// Default value: 256.
|
|||
/// </summary>
|
|||
public static int MaxNameLength { get; set; } = 256; |
|||
/// <summary>
|
|||
/// Default value: 256.
|
|||
/// </summary>
|
|||
public static int MaxNameLength { get; set; } = 256; |
|||
|
|||
/// <summary>
|
|||
/// Default value: <see cref="int.MaxValue"/> (2GB).
|
|||
/// </summary>
|
|||
public static int MaxContentLength { get; set; } = int.MaxValue; |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// Default value: <see cref="int.MaxValue"/> (2GB).
|
|||
/// </summary>
|
|||
public static int MaxContentLength { get; set; } = int.MaxValue; |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
public static class DatabaseContainerConsts |
|||
{ |
|||
public static class DatabaseContainerConsts |
|||
{ |
|||
/// <summary>
|
|||
/// Default value: 128.
|
|||
/// </summary>
|
|||
public static int MaxNameLength { get; set; } = 128; |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// Default value: 128.
|
|||
/// </summary>
|
|||
public static int MaxNameLength { get; set; } = 128; |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database.Localization |
|||
namespace Volo.Abp.BlobStoring.Database.Localization; |
|||
|
|||
[LocalizationResourceName("BlobStoringDatabase")] |
|||
public class BlobStoringDatabaseResource |
|||
{ |
|||
[LocalizationResourceName("BlobStoringDatabase")] |
|||
public class BlobStoringDatabaseResource |
|||
{ |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
@ -1,13 +1,12 @@ |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
public static class BlobStoringDatabaseDbProperties |
|||
{ |
|||
public static class BlobStoringDatabaseDbProperties |
|||
{ |
|||
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; |
|||
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; |
|||
|
|||
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; |
|||
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; |
|||
|
|||
public const string ConnectionStringName = "AbpBlobStoring"; |
|||
} |
|||
public const string ConnectionStringName = "AbpBlobStoring"; |
|||
} |
|||
|
|||
@ -1,27 +1,26 @@ |
|||
using Volo.Abp.Domain; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpDddDomainModule), |
|||
typeof(AbpBlobStoringModule), |
|||
typeof(BlobStoringDatabaseDomainSharedModule) |
|||
)] |
|||
public class BlobStoringDatabaseDomainModule : AbpModule |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpDddDomainModule), |
|||
typeof(AbpBlobStoringModule), |
|||
typeof(BlobStoringDatabaseDomainSharedModule) |
|||
)] |
|||
public class BlobStoringDatabaseDomainModule : AbpModule |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
Configure<AbpBlobStoringOptions>(options => |
|||
{ |
|||
Configure<AbpBlobStoringOptions>(options => |
|||
options.Containers.ConfigureDefault(container => |
|||
{ |
|||
options.Containers.ConfigureDefault(container => |
|||
if (container.ProviderType == null) |
|||
{ |
|||
if (container.ProviderType == null) |
|||
{ |
|||
container.UseDatabase(); |
|||
} |
|||
}); |
|||
container.UseDatabase(); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
|
|||
@ -1,12 +1,11 @@ |
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
public static class DatabaseBlobContainerConfigurationExtensions |
|||
{ |
|||
public static class DatabaseBlobContainerConfigurationExtensions |
|||
public static BlobContainerConfiguration UseDatabase( |
|||
this BlobContainerConfiguration containerConfiguration) |
|||
{ |
|||
public static BlobContainerConfiguration UseDatabase( |
|||
this BlobContainerConfiguration containerConfiguration) |
|||
{ |
|||
containerConfiguration.ProviderType = typeof(DatabaseBlobProvider); |
|||
return containerConfiguration; |
|||
} |
|||
containerConfiguration.ProviderType = typeof(DatabaseBlobProvider); |
|||
return containerConfiguration; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,48 +1,47 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore; |
|||
|
|||
public static class BlobStoringDbContextModelCreatingExtensions |
|||
{ |
|||
public static class BlobStoringDbContextModelCreatingExtensions |
|||
public static void ConfigureBlobStoring( |
|||
this ModelBuilder builder) |
|||
{ |
|||
public static void ConfigureBlobStoring( |
|||
this ModelBuilder builder) |
|||
{ |
|||
Check.NotNull(builder, nameof(builder)); |
|||
Check.NotNull(builder, nameof(builder)); |
|||
|
|||
builder.Entity<DatabaseBlobContainer>(b => |
|||
{ |
|||
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema); |
|||
builder.Entity<DatabaseBlobContainer>(b => |
|||
{ |
|||
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema); |
|||
|
|||
b.ConfigureByConvention(); |
|||
b.ConfigureByConvention(); |
|||
|
|||
b.Property(p => p.Name).IsRequired().HasMaxLength(DatabaseContainerConsts.MaxNameLength); |
|||
b.Property(p => p.Name).IsRequired().HasMaxLength(DatabaseContainerConsts.MaxNameLength); |
|||
|
|||
b.HasMany<DatabaseBlob>().WithOne().HasForeignKey(p => p.ContainerId); |
|||
b.HasMany<DatabaseBlob>().WithOne().HasForeignKey(p => p.ContainerId); |
|||
|
|||
b.HasIndex(x => new {x.TenantId, x.Name}); |
|||
b.HasIndex(x => new { x.TenantId, x.Name }); |
|||
|
|||
b.ApplyObjectExtensionMappings(); |
|||
}); |
|||
b.ApplyObjectExtensionMappings(); |
|||
}); |
|||
|
|||
builder.Entity<DatabaseBlob>(b => |
|||
{ |
|||
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema); |
|||
builder.Entity<DatabaseBlob>(b => |
|||
{ |
|||
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema); |
|||
|
|||
b.ConfigureByConvention(); |
|||
b.ConfigureByConvention(); |
|||
|
|||
b.Property(p => p.ContainerId).IsRequired(); //TODO: Foreign key!
|
|||
b.Property(p => p.ContainerId).IsRequired(); //TODO: Foreign key!
|
|||
b.Property(p => p.Name).IsRequired().HasMaxLength(DatabaseBlobConsts.MaxNameLength); |
|||
b.Property(p => p.Content).HasMaxLength(DatabaseBlobConsts.MaxContentLength); |
|||
b.Property(p => p.Content).HasMaxLength(DatabaseBlobConsts.MaxContentLength); |
|||
|
|||
b.HasOne<DatabaseBlobContainer>().WithMany().HasForeignKey(p => p.ContainerId); |
|||
b.HasOne<DatabaseBlobContainer>().WithMany().HasForeignKey(p => p.ContainerId); |
|||
|
|||
b.HasIndex(x => new {x.TenantId, x.ContainerId, x.Name}); |
|||
b.HasIndex(x => new { x.TenantId, x.ContainerId, x.Name }); |
|||
|
|||
b.ApplyObjectExtensionMappings(); |
|||
}); |
|||
b.ApplyObjectExtensionMappings(); |
|||
}); |
|||
|
|||
builder.TryConfigureObjectExtensions<BlobStoringDbContext>(); |
|||
} |
|||
builder.TryConfigureObjectExtensions<BlobStoringDbContext>(); |
|||
} |
|||
} |
|||
|
|||
@ -1,23 +1,22 @@ |
|||
using Volo.Abp.MongoDB; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB |
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB; |
|||
|
|||
public static class BlobStoringMongoDbContextExtensions |
|||
{ |
|||
public static class BlobStoringMongoDbContextExtensions |
|||
public static void ConfigureBlobStoring( |
|||
this IMongoModelBuilder builder) |
|||
{ |
|||
public static void ConfigureBlobStoring( |
|||
this IMongoModelBuilder builder) |
|||
{ |
|||
Check.NotNull(builder, nameof(builder)); |
|||
Check.NotNull(builder, nameof(builder)); |
|||
|
|||
builder.Entity<DatabaseBlobContainer>(b => |
|||
{ |
|||
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers"; |
|||
}); |
|||
builder.Entity<DatabaseBlobContainer>(b => |
|||
{ |
|||
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers"; |
|||
}); |
|||
|
|||
builder.Entity<DatabaseBlob>(b => |
|||
{ |
|||
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs"; |
|||
}); |
|||
} |
|||
builder.Entity<DatabaseBlob>(b => |
|||
{ |
|||
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs"; |
|||
}); |
|||
} |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
/* Inherit from this class for your domain layer tests. |
|||
* See SampleManager_Tests for example. |
|||
*/ |
|||
public abstract class BlobStoringDatabaseDomainTestBase : BlobStoringDatabaseTestBase<BlobStoringDatabaseDomainTestModule> |
|||
{ |
|||
/* Inherit from this class for your domain layer tests. |
|||
* See SampleManager_Tests for example. |
|||
*/ |
|||
public abstract class BlobStoringDatabaseDomainTestBase : BlobStoringDatabaseTestBase<BlobStoringDatabaseDomainTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,13 +1,12 @@ |
|||
using Volo.Abp.BlobStoring.Database.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
[DependsOn( |
|||
typeof(BlobStoringDatabaseEntityFrameworkCoreTestModule) |
|||
)] |
|||
public class BlobStoringDatabaseDomainTestModule : AbpModule |
|||
{ |
|||
[DependsOn( |
|||
typeof(BlobStoringDatabaseEntityFrameworkCoreTestModule) |
|||
)] |
|||
public class BlobStoringDatabaseDomainTestModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
@ -1,7 +1,6 @@ |
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore; |
|||
|
|||
public abstract class BlobStoringDatabaseEntityFrameworkCoreTestBase : BlobStoringDatabaseTestBase<BlobStoringDatabaseEntityFrameworkCoreTestModule> |
|||
{ |
|||
public abstract class BlobStoringDatabaseEntityFrameworkCoreTestBase : BlobStoringDatabaseTestBase<BlobStoringDatabaseEntityFrameworkCoreTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,7 +1,6 @@ |
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore; |
|||
|
|||
public class EfCoreContainer_Tests : BlobContainer_Tests<BlobStoringDatabaseEntityFrameworkCoreTestModule> |
|||
{ |
|||
public class EfCoreContainer_Tests : BlobContainer_Tests<BlobStoringDatabaseEntityFrameworkCoreTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
@ -1,7 +1,6 @@ |
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
|||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore; |
|||
|
|||
public class EfCoreDatabaseBlobContainer_Tests : DatabaseBlobContainer_Tests<BlobStoringDatabaseEntityFrameworkCoreTestModule> |
|||
{ |
|||
public class EfCoreDatabaseBlobContainer_Tests : DatabaseBlobContainer_Tests<BlobStoringDatabaseEntityFrameworkCoreTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
@ -1,7 +1,6 @@ |
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB |
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB; |
|||
|
|||
public abstract class BlobStoringDatabaseMongoDbTestBase : BlobStoringDatabaseTestBase<BlobStoringDatabaseMongoDbTestModule> |
|||
{ |
|||
public abstract class BlobStoringDatabaseMongoDbTestBase : BlobStoringDatabaseTestBase<BlobStoringDatabaseMongoDbTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB |
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB; |
|||
|
|||
[Collection(MongoTestCollection.Name)] |
|||
public class MongoDbContainer_Tests : BlobContainer_Tests<BlobStoringDatabaseMongoDbTestModule> |
|||
{ |
|||
[Collection(MongoTestCollection.Name)] |
|||
public class MongoDbContainer_Tests : BlobContainer_Tests<BlobStoringDatabaseMongoDbTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB |
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB; |
|||
|
|||
[Collection(MongoTestCollection.Name)] |
|||
public class MongoDbDatabaseBlobContainer_Tests : DatabaseBlobContainer_Tests<BlobStoringDatabaseMongoDbTestModule> |
|||
{ |
|||
[Collection(MongoTestCollection.Name)] |
|||
public class MongoDbDatabaseBlobContainer_Tests : DatabaseBlobContainer_Tests<BlobStoringDatabaseMongoDbTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
@ -1,22 +1,21 @@ |
|||
using System; |
|||
using Mongo2Go; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB |
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB; |
|||
|
|||
public class MongoDbFixture : IDisposable |
|||
{ |
|||
public class MongoDbFixture : IDisposable |
|||
{ |
|||
private static readonly MongoDbRunner MongoDbRunner; |
|||
public static readonly string ConnectionString; |
|||
private static readonly MongoDbRunner MongoDbRunner; |
|||
public static readonly string ConnectionString; |
|||
|
|||
static MongoDbFixture() |
|||
{ |
|||
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|||
ConnectionString = MongoDbRunner.ConnectionString; |
|||
} |
|||
static MongoDbFixture() |
|||
{ |
|||
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|||
ConnectionString = MongoDbRunner.ConnectionString; |
|||
} |
|||
|
|||
public void Dispose() |
|||
{ |
|||
MongoDbRunner?.Dispose(); |
|||
} |
|||
public void Dispose() |
|||
{ |
|||
MongoDbRunner?.Dispose(); |
|||
} |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB |
|||
namespace Volo.Abp.BlobStoring.Database.MongoDB; |
|||
|
|||
[CollectionDefinition(Name)] |
|||
public class MongoTestCollection : ICollectionFixture<MongoDbFixture> |
|||
{ |
|||
[CollectionDefinition(Name)] |
|||
public class MongoTestCollection : ICollectionFixture<MongoDbFixture> |
|||
{ |
|||
public const string Name = "MongoDB Collection"; |
|||
} |
|||
} |
|||
public const string Name = "MongoDB Collection"; |
|||
} |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.BlobStoring.Database |
|||
namespace Volo.Abp.BlobStoring.Database; |
|||
|
|||
public abstract class DatabaseBlobContainer_Tests<TStartupModule> : BlobContainer_Tests<TStartupModule> |
|||
where TStartupModule : IAbpModule |
|||
{ |
|||
public abstract class DatabaseBlobContainer_Tests<TStartupModule> : BlobContainer_Tests<TStartupModule> |
|||
where TStartupModule : IAbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue