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
+3 -3
View File
@@ -20,7 +20,7 @@ public class UpdateItemHander(IDbContextFactory<WalletContext> dbContextFactory,
try
{
using WalletContext context = await dbContextFactory.CreateDbContextAsync(cancellationToken);
ItemEntry? result = result = await context.Set<ItemEntry>()
ItemEntity? result = result = await context.Set<ItemEntity>()
.Include(x => x.Image).FirstOrDefaultAsync(x => x.Id == id, cancellationToken);
if (result is not null)
@@ -40,7 +40,7 @@ public class UpdateItemHander(IDbContextFactory<WalletContext> dbContextFactory,
imageWriter.Write(imageDescriptor, memoryStream);
thumbData = memoryStream.ToArray();
if (result.Image is BlobEntry existingImageBlob)
if (result.Image is BlobEntity existingImageBlob)
{
existingImageBlob.Data = thumbData;
existingImageBlob.DateTime = DateTime.UtcNow;
@@ -49,7 +49,7 @@ public class UpdateItemHander(IDbContextFactory<WalletContext> dbContextFactory,
}
else
{
result.Image = new BlobEntry
result.Image = new BlobEntity
{
Id = Guid.NewGuid(),
Data = thumbData,