This commit is contained in:
Tizian.Breuch
2025-07-22 08:59:31 +02:00
parent 7100949276
commit 9429468424
7 changed files with 16 additions and 12 deletions

View File

@@ -28,8 +28,13 @@ namespace Webshop.Infrastructure.Repositories
public async Task AddProductAsync(Product product)
{
_context.Products.Add(product);
await _context.SaveChangesAsync(); // Wichtig: Änderungen speichern
await _context.Products.AddAsync(product);
await _context.SaveChangesAsync();
}
public async Task<bool> ProductExistsBySlugAsync(string slug)
{
return await _context.Products.AnyAsync(p => p.Slug == slug);
}
public async Task UpdateProductAsync(Product product)

View File

@@ -17,9 +17,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Webshop.Domain\Webshop.Domain.csproj" />
<ProjectReference Include="..\Webshop.Domain\Shop.Domain.csproj" />
</ItemGroup>
</Project>