mirror of https://github.com/abpframework/abp.git
41 changed files with 286 additions and 295 deletions
@ -1,9 +0,0 @@ |
|||||
namespace Volo.Abp.BlobStoring.Database |
|
||||
{ |
|
||||
public static class BlobConsts |
|
||||
{ |
|
||||
public const int MaxNameLength = 256; |
|
||||
|
|
||||
public const int MaxContentLength = 2_000_000_000; // 2 GB
|
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,15 @@ |
|||||
|
namespace Volo.Abp.BlobStoring.Database |
||||
|
{ |
||||
|
public static class DatabaseBlobConsts |
||||
|
{ |
||||
|
/// <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; |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Volo.Abp.BlobStoring.Database |
namespace Volo.Abp.BlobStoring.Database |
||||
{ |
{ |
||||
public static class ContainerConsts |
public static class DatabaseContainerConsts |
||||
{ |
{ |
||||
public const int MaxNameLength = 128; |
public const int MaxNameLength = 128; |
||||
} |
} |
||||
@ -1,30 +1,11 @@ |
|||||
using System; |
namespace Volo.Abp.BlobStoring.Database |
||||
|
|
||||
namespace Volo.Abp.BlobStoring.Database |
|
||||
{ |
{ |
||||
public static class DatabaseBlobContainerConfigurationExtensions |
public static class DatabaseBlobContainerConfigurationExtensions |
||||
{ |
{ |
||||
public static DatabaseBlobProviderConfiguration GetDatabaseConfiguration( |
|
||||
this BlobContainerConfiguration containerConfiguration) |
|
||||
{ |
|
||||
return new DatabaseBlobProviderConfiguration(containerConfiguration); |
|
||||
} |
|
||||
|
|
||||
public static BlobContainerConfiguration UseDatabase( |
public static BlobContainerConfiguration UseDatabase( |
||||
this BlobContainerConfiguration containerConfiguration, |
this BlobContainerConfiguration containerConfiguration) |
||||
Action<DatabaseBlobProviderConfiguration> databaseConfigureAction) |
|
||||
{ |
|
||||
containerConfiguration.ProviderType = typeof(DatabaseBlobProvider); |
|
||||
|
|
||||
databaseConfigureAction(new DatabaseBlobProviderConfiguration(containerConfiguration)); |
|
||||
|
|
||||
return containerConfiguration; |
|
||||
} |
|
||||
|
|
||||
public static BlobContainerConfiguration UseDatabase(this BlobContainerConfiguration containerConfiguration) |
|
||||
{ |
{ |
||||
containerConfiguration.ProviderType = typeof(DatabaseBlobProvider); |
containerConfiguration.ProviderType = typeof(DatabaseBlobProvider); |
||||
|
|
||||
return containerConfiguration; |
return containerConfiguration; |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,12 +0,0 @@ |
|||||
namespace Volo.Abp.BlobStoring.Database |
|
||||
{ |
|
||||
public class DatabaseBlobProviderConfiguration |
|
||||
{ |
|
||||
private readonly BlobContainerConfiguration _containerConfiguration; |
|
||||
|
|
||||
public DatabaseBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration) |
|
||||
{ |
|
||||
_containerConfiguration = containerConfiguration; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,15 +0,0 @@ |
|||||
using System; |
|
||||
using System.Threading; |
|
||||
using System.Threading.Tasks; |
|
||||
using JetBrains.Annotations; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
|
|
||||
namespace Volo.Abp.BlobStoring.Database |
|
||||
{ |
|
||||
public interface IContainerRepository : IBasicRepository<Container, Guid> |
|
||||
{ |
|
||||
Task<Container> CreateIfNotExistAsync([NotNull] string name, Guid? tenantId = null, CancellationToken cancellationToken = default); |
|
||||
|
|
||||
Task<Container> FindAsync([NotNull] string name, Guid? tenantId = null, CancellationToken cancellationToken = default); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,13 @@ |
|||||
|
using System; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using JetBrains.Annotations; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
|
||||
|
namespace Volo.Abp.BlobStoring.Database |
||||
|
{ |
||||
|
public interface IDatabaseBlobContainerRepository : IBasicRepository<DatabaseBlobContainer, Guid> |
||||
|
{ |
||||
|
Task<DatabaseBlobContainer> FindAsync([NotNull] string name, Guid? tenantId = null, CancellationToken cancellationToken = default); |
||||
|
} |
||||
|
} |
||||
@ -1,47 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
|
||||
using System; |
|
||||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|
||||
|
|
||||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
|
||||
{ |
|
||||
public static class BlobStoringDatabaseDbContextModelCreatingExtensions |
|
||||
{ |
|
||||
public static void ConfigureDatabaseBlobStoring( |
|
||||
this ModelBuilder builder, |
|
||||
Action<BlobStoringDatabaseModelBuilderConfigurationOptions> optionsAction = null) |
|
||||
{ |
|
||||
Check.NotNull(builder, nameof(builder)); |
|
||||
|
|
||||
var options = new BlobStoringDatabaseModelBuilderConfigurationOptions( |
|
||||
BlobStoringDatabaseDbProperties.DbTablePrefix, |
|
||||
BlobStoringDatabaseDbProperties.DbSchema |
|
||||
); |
|
||||
|
|
||||
optionsAction?.Invoke(options); |
|
||||
|
|
||||
builder.Entity<Container>(b => |
|
||||
{ |
|
||||
b.ToTable(options.TablePrefix + "Containers", options.Schema); |
|
||||
|
|
||||
b.ConfigureByConvention(); |
|
||||
|
|
||||
b.Property(p => p.Name).IsRequired().HasMaxLength(ContainerConsts.MaxNameLength); |
|
||||
|
|
||||
b.HasIndex(x => x.Name); |
|
||||
}); |
|
||||
|
|
||||
builder.Entity<Blob>(b => |
|
||||
{ |
|
||||
b.ToTable(options.TablePrefix + "Blobs", options.Schema); |
|
||||
|
|
||||
b.ConfigureByConvention(); |
|
||||
|
|
||||
b.Property(p => p.Name).IsRequired().HasMaxLength(BlobConsts.MaxNameLength); |
|
||||
b.Property(p => p.ContainerId).IsRequired(); |
|
||||
b.Property(p => p.Content).HasMaxLength(BlobConsts.MaxContentLength); |
|
||||
|
|
||||
b.HasIndex(x => x.Name); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
11
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDatabaseDbContext.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContext.cs
11
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDatabaseDbContext.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContext.cs
@ -0,0 +1,47 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using System; |
||||
|
using Volo.Abp.EntityFrameworkCore.Modeling; |
||||
|
|
||||
|
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
||||
|
{ |
||||
|
public static class BlobStoringDbContextModelCreatingExtensions |
||||
|
{ |
||||
|
public static void ConfigureBlobStoring( |
||||
|
this ModelBuilder builder, |
||||
|
Action<BlobStoringModelBuilderConfigurationOptions> optionsAction = null) |
||||
|
{ |
||||
|
Check.NotNull(builder, nameof(builder)); |
||||
|
|
||||
|
var options = new BlobStoringModelBuilderConfigurationOptions( |
||||
|
BlobStoringDatabaseDbProperties.DbTablePrefix, |
||||
|
BlobStoringDatabaseDbProperties.DbSchema |
||||
|
); |
||||
|
|
||||
|
optionsAction?.Invoke(options); |
||||
|
|
||||
|
builder.Entity<DatabaseBlobContainer>(b => |
||||
|
{ |
||||
|
b.ToTable(options.TablePrefix + "BlobContainers", options.Schema); |
||||
|
|
||||
|
b.ConfigureByConvention(); |
||||
|
|
||||
|
b.Property(p => p.Name).IsRequired().HasMaxLength(DatabaseContainerConsts.MaxNameLength); |
||||
|
|
||||
|
b.HasIndex(x => new {x.TenantId, x.Name}); |
||||
|
}); |
||||
|
|
||||
|
builder.Entity<DatabaseBlob>(b => |
||||
|
{ |
||||
|
b.ToTable(options.TablePrefix + "Blobs", options.Schema); |
||||
|
|
||||
|
b.ConfigureByConvention(); |
||||
|
|
||||
|
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.HasIndex(x => new {x.TenantId, x.ContainerId, x.Name}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
4
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDatabaseModelBuilderConfigurationOptions.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs
4
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDatabaseModelBuilderConfigurationOptions.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs
@ -1,47 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
|
||||
using System; |
|
||||
using System.Threading; |
|
||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|
||||
using Volo.Abp.EntityFrameworkCore; |
|
||||
|
|
||||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
|
||||
{ |
|
||||
public class EfCoreBlobRepository : EfCoreRepository<IBlobStoringDatabaseDbContext, Blob, Guid>, IBlobRepository |
|
||||
{ |
|
||||
public EfCoreBlobRepository(IDbContextProvider<IBlobStoringDatabaseDbContext> dbContextProvider) : base(dbContextProvider) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<Blob> FindAsync(Guid containerId, string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
|
||||
{ |
|
||||
return await DbSet.FirstOrDefaultAsync( |
|
||||
x => x.ContainerId == containerId && |
|
||||
x.Name == name && |
|
||||
x.TenantId == tenantId, |
|
||||
GetCancellationToken(cancellationToken)); |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<bool> ExistsAsync(Guid containerId, string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
|
||||
{ |
|
||||
return await DbSet.AnyAsync( |
|
||||
x => x.ContainerId == containerId && |
|
||||
x.Name == name && |
|
||||
x.TenantId == tenantId, |
|
||||
GetCancellationToken(cancellationToken)); |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<bool> DeleteAsync(Guid containerId, string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
|
||||
{ |
|
||||
var blob = await FindAsync(containerId, name, tenantId, cancellationToken); |
|
||||
|
|
||||
if (blob == null) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
await base.DeleteAsync(blob.Id, cancellationToken: GetCancellationToken(cancellationToken)); |
|
||||
return true; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,37 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
|
||||
using System; |
|
||||
using System.Linq; |
|
||||
using System.Threading; |
|
||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|
||||
using Volo.Abp.EntityFrameworkCore; |
|
||||
|
|
||||
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
|
||||
{ |
|
||||
public class EfCoreContainerRepository : EfCoreRepository<IBlobStoringDatabaseDbContext, Container, Guid>, IContainerRepository |
|
||||
{ |
|
||||
public EfCoreContainerRepository(IDbContextProvider<IBlobStoringDatabaseDbContext> dbContextProvider) : base(dbContextProvider) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<Container> CreateIfNotExistAsync(string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
|
||||
{ |
|
||||
var container = await FindAsync(name, tenantId, cancellationToken); |
|
||||
if (container != null) |
|
||||
{ |
|
||||
return container; |
|
||||
} |
|
||||
|
|
||||
container = new Container(Guid.NewGuid(), name, tenantId); |
|
||||
await base.InsertAsync(container, true, GetCancellationToken(cancellationToken)); |
|
||||
|
|
||||
return container; |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<Container> FindAsync(string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
|
||||
{ |
|
||||
return await DbSet.WhereIf(tenantId != null, x => x.TenantId == tenantId) |
|
||||
.FirstOrDefaultAsync(x => x.Name == name, GetCancellationToken(cancellationToken)); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,24 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using System; |
||||
|
using System.Linq; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
||||
|
{ |
||||
|
public class EfCoreDatabaseBlobContainerRepository : EfCoreRepository<IBlobStoringDbContext, DatabaseBlobContainer, Guid>, IDatabaseBlobContainerRepository |
||||
|
{ |
||||
|
public EfCoreDatabaseBlobContainerRepository(IDbContextProvider<IBlobStoringDbContext> dbContextProvider) |
||||
|
: base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<DatabaseBlobContainer> FindAsync(string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
||||
|
{ |
||||
|
return await DbSet.WhereIf(tenantId != null, x => x.TenantId == tenantId) |
||||
|
.FirstOrDefaultAsync(x => x.Name == name, GetCancellationToken(cancellationToken)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,58 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using System; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore |
||||
|
{ |
||||
|
public class EfCoreDatabaseBlobRepository : EfCoreRepository<IBlobStoringDbContext, DatabaseBlob, Guid>, IDatabaseBlobRepository |
||||
|
{ |
||||
|
public EfCoreDatabaseBlobRepository(IDbContextProvider<IBlobStoringDbContext> dbContextProvider) |
||||
|
: base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<DatabaseBlob> FindAsync( |
||||
|
Guid containerId, |
||||
|
string name, |
||||
|
Guid? tenantId = null, |
||||
|
CancellationToken cancellationToken = default) |
||||
|
{ |
||||
|
return await DbSet.FirstOrDefaultAsync( |
||||
|
x => x.ContainerId == containerId && x.Name == name && x.TenantId == tenantId, |
||||
|
GetCancellationToken(cancellationToken) |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<bool> ExistsAsync( |
||||
|
Guid containerId, |
||||
|
string name, |
||||
|
Guid? tenantId = null, |
||||
|
CancellationToken cancellationToken = default) |
||||
|
{ |
||||
|
return await DbSet.AnyAsync( |
||||
|
x => x.ContainerId == containerId && |
||||
|
x.Name == name && |
||||
|
x.TenantId == tenantId, |
||||
|
GetCancellationToken(cancellationToken)); |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<bool> DeleteAsync( |
||||
|
Guid containerId, |
||||
|
string name, |
||||
|
Guid? tenantId = null, |
||||
|
CancellationToken cancellationToken = default) |
||||
|
{ |
||||
|
var blob = await FindAsync(containerId, name, tenantId, cancellationToken); |
||||
|
if (blob == null) |
||||
|
{ |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
await base.DeleteAsync(blob.Id, cancellationToken: GetCancellationToken(cancellationToken)); |
||||
|
return true; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
6
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDatabaseDbContext.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDbContext.cs
6
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDatabaseDbContext.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDbContext.cs
12
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringDatabaseMongoDbContextExtensions.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs
12
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringDatabaseMongoDbContextExtensions.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs
4
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringDatabaseMongoModelBuilderConfigurationOptions.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs
4
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringDatabaseMongoModelBuilderConfigurationOptions.cs → modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs
@ -1,35 +0,0 @@ |
|||||
using System; |
|
||||
using System.Threading; |
|
||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.Domain.Repositories.MongoDB; |
|
||||
using Volo.Abp.MongoDB; |
|
||||
|
|
||||
namespace Volo.Abp.BlobStoring.Database.MongoDB |
|
||||
{ |
|
||||
public class MongoDbContainerRepository : MongoDbRepository<IBlobStoringDatabaseMongoDbContext, Container, Guid>, IContainerRepository |
|
||||
{ |
|
||||
public MongoDbContainerRepository(IMongoDbContextProvider<IBlobStoringDatabaseMongoDbContext> dbContextProvider) : base(dbContextProvider) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<Container> CreateIfNotExistAsync(string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
|
||||
{ |
|
||||
var container = await FindAsync(name, tenantId, cancellationToken); |
|
||||
|
|
||||
if (container != null) |
|
||||
{ |
|
||||
return container; |
|
||||
} |
|
||||
|
|
||||
container = new Container(Guid.NewGuid(), name, tenantId); |
|
||||
await InsertAsync(container, true, GetCancellationToken(cancellationToken)); |
|
||||
|
|
||||
return container; |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<Container> FindAsync(string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
|
||||
{ |
|
||||
return await base.FindAsync(x => x.Name == name, cancellationToken: GetCancellationToken(cancellationToken)); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,21 @@ |
|||||
|
using System; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Repositories.MongoDB; |
||||
|
using Volo.Abp.MongoDB; |
||||
|
|
||||
|
namespace Volo.Abp.BlobStoring.Database.MongoDB |
||||
|
{ |
||||
|
public class MongoDbDatabaseBlobContainerRepository : MongoDbRepository<IBlobStoringMongoDbContext, DatabaseBlobContainer, Guid>, IDatabaseBlobContainerRepository |
||||
|
{ |
||||
|
public MongoDbDatabaseBlobContainerRepository(IMongoDbContextProvider<IBlobStoringMongoDbContext> dbContextProvider) |
||||
|
: base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<DatabaseBlobContainer> FindAsync(string name, Guid? tenantId = null, CancellationToken cancellationToken = default) |
||||
|
{ |
||||
|
return await base.FindAsync(x => x.Name == name && x.TenantId == tenantId, cancellationToken: GetCancellationToken(cancellationToken)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue