Add validation

This commit is contained in:
TheXamlGuy
2024-07-07 20:09:03 +01:00
parent 015af41fc8
commit 75bdd275c9
16 changed files with 142 additions and 104 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ public class ItemImageHandler(IDbContextFactory<WalletContext> dbContextFactory,
Guid id = item.Value;
using WalletContext context = await dbContextFactory.CreateDbContextAsync(cancellationToken);
var result = await context.Set<ItemEntry>()
var result = await context.Set<ItemEntity>()
.Where(x => x.Id == id)
.Select(x => new
{
@@ -25,7 +25,7 @@ public class ItemImageHandler(IDbContextFactory<WalletContext> dbContextFactory,
.FirstOrDefaultAsync(cancellationToken);
if (result is not null &&
result.Image is BlobEntry image &&
result.Image is BlobEntity image &&
image.Data is { Length: > 0 } data)
{
MemoryStream stream = new(data);