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
+4 -4
View File
@@ -28,12 +28,12 @@ public class CreateItemHandler(IImageWriter imageWriter,
thumbData = memoryStream.ToArray();
}
ItemEntry itemEntry = new()
ItemEntity itemEntry = new()
{
Id = id,
Name = name,
Category = category,
Image = thumbData != null ? new BlobEntry
Image = thumbData != null ? new BlobEntity
{
Id = Guid.NewGuid(),
Data = thumbData,
@@ -42,7 +42,7 @@ public class CreateItemHandler(IImageWriter imageWriter,
} : null,
Blobs =
{
new BlobEntry
new BlobEntity
{
Id = Guid.NewGuid(),
Data = Encoding.UTF8.GetBytes(content),
@@ -53,7 +53,7 @@ public class CreateItemHandler(IImageWriter imageWriter,
};
using WalletContext context = await dbContextFactory.CreateDbContextAsync(cancellationToken);
EntityEntry<ItemEntry>? result = await context.AddAsync(itemEntry, cancellationToken);
EntityEntry<ItemEntity>? result = await context.AddAsync(itemEntry, cancellationToken);
await context.SaveChangesAsync(cancellationToken);