Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using JetBrains.Annotations;
using System;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;

Expand All @@ -13,6 +14,7 @@ public class DatabaseBlob : AggregateRoot<Guid>, IMultiTenant

public virtual string Name { get; protected set; }

[DisableAuditing]
public virtual byte[] Content { get; protected set; }

public DatabaseBlob(Guid id, Guid containerId, [NotNull] string name, [NotNull] byte[] content, Guid? tenantId = null)
Expand All @@ -32,7 +34,7 @@ public virtual void SetContent(byte[] content)
protected virtual byte[] CheckContentLength(byte[] content)
{
Check.NotNull(content, nameof(content));

if (content.Length >= DatabaseBlobConsts.MaxContentLength)
{
throw new AbpException($"Blob content size cannot be more than {DatabaseBlobConsts.MaxContentLength} Bytes.");
Expand All @@ -41,4 +43,4 @@ protected virtual byte[] CheckContentLength(byte[] content)
return content;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
Expand All @@ -20,10 +21,9 @@ public virtual async Task<DatabaseBlob> FindAsync(
string name,
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.FirstOrDefaultAsync(
x => x.ContainerId == containerId && x.Name == name,
GetCancellationToken(cancellationToken)
return (await GetDbSetAsync())
.FirstOrDefault(
x => x.ContainerId == containerId && x.Name == name
);
}

Expand Down